NEGBINOMDIST Function (OpenOffice Calc)
Calculate failure-count probabilities with Apache OpenOffice Calc NEGBINOMDIST, using its exact count guards and avoiding misleading fractional-count coercion.
Verification status: Official release source and independently calculated examples for NEGBINOMDIST were reviewed. No new Apache OpenOffice Calc application execution is claimed for this guide; the stated version and example limits still apply. How formula examples are checked
Quick answer: =NEGBINOMDIST(2;3;0.5) returns 0.1875, the probability of two failures before the third success when each independent attempt succeeds with probability 0.5.
Availability and version history
- Introduced: First release not established. The OpenOffice.org 3.3 function appendix documents this name; that is presence evidence, not its introduction date.
- Supported in: Apache OpenOffice 4.1.16, with no final supported release established.
- Scope: Desktop Calc; English names and semicolon separators are used below. The numeric contract refers to the cited release.
- Checked: October 14, 2026. Retained official documentation/source and independent mathematics checked; no new Apache OpenOffice Calc execution is claimed.
What is being counted?
The first argument counts failures before the target success, not the total number of attempts. For failures f≥0, integer success target r≥1 and success probability p, the ordinary mass is COMBIN(f+r−1;f)×p^r×(1−p)^f. The final attempt must be a success; the preceding attempts contain the other r−1 successes and f failures. Function-specific implementation.
The model assumes independent attempts and a constant success probability. It is useful for repeat-until-success processes only when those assumptions fit. A fixed number of attempts with a random success count is a binomial question instead.
Syntax and model inputs
=NEGBINOMDIST(Failures; Successes; Probability)
All three arguments are required. Use a nonnegative integer Failures, a positive integer Successes and a probability from 0 through 1. There is no cumulative switch in this spelling. It returns the probability of exactly the specified failure count. Do not add a fourth argument copied from a different spreadsheet function.
Apache OpenOffice rejects negative count arguments and p outside [0,1], but its evaluator does not floor either count. Its loop runs once for each integer i with 0≤i<failures. Therefore a positive fractional failure count effectively controls the number of loop iterations by its ceiling, while a fractional success target remains in the factors. Such results are not ordinary count-model probabilities.
Reproducible reference cases
These positive-integer model cases were independently calculated; no new runtime output is claimed. Results are rounded to twelve decimal places where necessary.
| Formula | Expected result, approximately |
|---|---|
=NEGBINOMDIST(0;3;.5) |
0.125 |
=NEGBINOMDIST(1;3;.5) |
0.1875 |
=NEGBINOMDIST(2;3;.5) |
0.1875 |
=NEGBINOMDIST(3;3;.5) |
0.15625 |
=NEGBINOMDIST(4;3;.5) |
0.1171875 |
=NEGBINOMDIST(2;5;.55) |
0.152872628906 |
=NEGBINOMDIST(0;2;1) |
1 |
=NEGBINOMDIST(1;2;1) |
0 |
Practical worksheet: failures before three successes
Put failure counts 0, 1, 2, 3 and 4 in A2:A6. Put target successes 3 in D2 and probability 0.5 in E2. In B2 enter =NEGBINOMDIST(A2;$D$2;$E$2) and fill down.
The first five masses are 0.125, 0.1875, 0.1875, 0.15625 and 0.1171875. Their sum is 0.7734375. It is below 1 because five or more failures remain possible; do not rescale the displayed rows and call the result the original distribution.
For row A4=2, the corresponding total attempt count is five. The 0.1875 value concerns stopping exactly at that point with the third success, not every arrangement having at least three successes in five attempts.
Advanced cumulative and cross-model check
The chance of at most two failures before the third success is the sum of the first three rows, 0.5. The same event is at least three successes within five attempts. Therefore =1-BINOMDIST(2;5;0.5;1) also gives 0.5.
This identity checks the event boundaries. Summing through failure 3 or subtracting BINOMDIST at success 3 changes the event by one count. Write the target inequality beside the formula rather than relying on a label such as “probability.”
Fractional counts, endpoints and cautions
For =NEGBINOMDIST(2.9;3.9;0.5), the pinned evaluator yields the independently derived value 0.157345554854. This comes from three loop iterations with success parameter 3.9, not from flooring both arguments to 2 and 3. This is a source-derived portability diagnostic, not a recommendation to enter fractional event counts or a recorded native test.
With a positive integer target, p=0 gives zero for the ordinary finite-failure examples that pass the guard. At p=1, zero failures has mass 1 and a positive failure count has mass 0. A zero success target is not the ordinary stopping model; do not treat the evaluator accepting it as validation of the statistical question.
Use explicit numeric and integer validation in reusable worksheets. Text conversion, empty cells and very large count loops need separate testing; a returned number alone does not show that a negative-binomial model was appropriate.
Official evidence and calculation scope
The examples were recomputed independently against the retained release contract. Native import, locale and extreme-input behavior is not newly certified.