# Documentation/Calc Functions/NEGBINOM.DIST

TDF LibreOffice Document Liberation Project Community Blogs Weblate Nextcloud Redmine Ask LibreOffice Donate

## Function name:

NEGBINOM.DIST

## Category:

Statistical Analysis

## Summary:

Calculate a probability mass function or a cumulative distribution function for the negative binomial distribution for the given data about the number of failures, successes, and the probability of success for each attempt.

## Syntax:

NEGBINOM.DIST(**X**; **R**; **SP**; **Cumulative**)

## Returns:

Returns a real number which is either a probability mass function or a cumulative distribution function for the negative binomial distribution with the count of the unsuccessful test as **X**, successful tests as **R**, and the probability of success as **SP**.

## Arguments:

**X** is an integer value or a reference to the cell containing that value which represents the value returned for unsuccessful tests.

**R** is an integer value or a reference to the cell containing that value which represents the value returned for successful tests.

**SP** is a real number between 0 and 1 or a reference to the cell containing that value which is the probability of the success of an attempt.

**Cumulative** specifies whether to calculate the probability mass function (FALSE or 0) or the cumulative distribution function (any other value).

- If
**R**is less than 1 or**X**is less than 0 then the function returns an error value. - If
**R**or**X**are non-integer values then the function takes the floor of their value, i.e. they are truncated to integers. - If
**SP**is greater than 1 or less than 0, then the function returns an error value.

## Additional details:

- The formula for NEGBINOM.DIST is:

If **Cumulative** is FALSE() and (**X** + **R** - 1)>=0 then the probability mass function value

If **Cumulative** is TRUE() and (**X** + **R** - 1)>=0 then the cumulative distribution function value

where x = **X**, r = **R** and p = **SP**

- For more details on the negative binomial distribution, visit Wikipedia.

## Examples:

Formula | Description | Returns |
---|---|---|

=NEGBINOM.DIST(5;12;0.5;0) | The function calculates the probability mass function for the negative binomial distribution for the given arguments. | 0.0333251953125 |

=NEGBINOM.DIST(4;12;0.5;1) | The function calculates the cumulative distribution function for the negative binomial distribution for the given arguments. | 0.038406372070313 |

=NEGBINOM.DIST(5;0.9;0.5;0) | The function returns an error value since R is less than 1. |
Err:502 |

## Related LibreOffice functions:

## ODF standard:

None

## Equivalent Excel functions:

NEGBINOM.DIST