NEGBINOM.DIST Function (LibreOffice Calc)
Learn the NEGBINOM.DIST function in LibreOffice Calc: Values of the negative binomial distribution.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Availability and version history
- Introduced: LibreOffice 4.3.
- Availability: Supported in LibreOffice 26.8.1.1, verified against its function registry. This identifies a supported release, not a final working version.
- Scope: Desktop Calc, using the English function name. Availability in other spreadsheet applications is separate.
- Checked: 2026-10-14 — function reference; versioned support. Documentation/source check; not a new native test. Existing example-specific test claims below retain their stated scope.
Historical validation scope: Native observations refer to saved LibreOffice Calc 25.2.3.2 Linux evidence dated 12 October 2026 at 15:44 UTC. All 37 ODS/result pairs and manifest hashes agree, comprising 31 numeric outputs and six error observations. This review independently checked the numeric outputs with exact-rational binomial probabilities and arithmetic. Calc was not rerun; no native Excel or Sheets tests are claimed.
What NEGBINOM.DIST calculates
Use NEGBINOM.DIST when a process has repeated, independent success/failure trials with the same probability of success each time, and you want to count the failures before the required number of successes. For example, if each prospect independently has a 25% chance of qualifying, the function can calculate how likely it is to reject exactly three prospects (or no more than three prospects) before achieving two qualified prospects. This is a negative binomial distribution, not the binomial distribution for a fixed number of trials. LibreOffice statistical-function Help documents the exact and cumulative modes; the help page is the authority for its Calc syntax.
The formula gives a probability between 0 and 1. To display it as a percentage, format the resulting cell as Percent; 0.10546875 is 10.546875%, rather than 0.10546875%.
Syntax and required arguments
=NEGBINOM.DIST(X; R; SP; Cumulative)
| Argument | Required? | What it means | Example |
|---|---|---|---|
X |
Yes | Number of failures before the target success | 3 |
R |
Yes | Required number of successes | 2 |
SP |
Yes | Probability of success in each trial; a fraction between 0 and 1 | 0.25 |
Cumulative |
Yes | 0/FALSE() for exactly X failures (PMF); 1/TRUE() for at most X failures (CDF) |
0 |
There is no optional argument in LibreOffice’s documented four-argument signature. If you omit Cumulative, a missing-parameter error was observed in Calc 25.2.3.2. See the official syntax and two worked examples (accessed 2026-10-12; Help identifies LibreOffice 4.3 as the introduction version).
Separators and languages: Formulas on this page use English function names, semicolons between arguments, and decimal points (as configured in the tested en-US-style Calc environment). LibreOffice allows English-function-name display and formula separators to be configured. Other locales may use different decimal separators or translated names; consult Tools → Options → LibreOffice Calc → Formula before copying literal examples. Do not replace separators without checking that setting. Official Formula Options, accessed 2026-10-12.
Basic examples (native Calc results)
These LibreOffice 26.8 Help examples were also successfully reproduced in native Calc 25.2.3.2:
| Formula | Result | Correct interpretation |
|---|---|---|
=NEGBINOM.DIST(1;1;0.5;0) |
0.25 |
Exactly one failure before the first success |
=NEGBINOM.DIST(1;1;0.5;1) |
0.75 |
Zero or one failure before the first success |
=NEGBINOM.DIST(3;2;0.25;0) |
0.10546875 |
Exactly three failures before the second success |
=NEGBINOM.DIST(3;2;0.25;1) |
0.3671875 |
At most three failures before the second success |
The last two values differ because the cumulative option adds probabilities for 0, 1, 2 and 3 failures rather than only the outcome X=3. Use Cumulative=0 for an exact count and Cumulative=1 for a threshold. See LibreOffice’s distribution documentation, accessed 2026-10-12.
Reproducible Calc worksheet: qualifying customers
Enter the following values into a new sheet, with the top row as headers:
| Cell | Header / value | Meaning |
|---|---|---|
A1 |
Failures (X) |
Number rejected |
B1 |
Successes (R) |
Number of qualified customers required |
C1 |
Success chance (SP) |
Per-customer qualification chance |
D1 |
Cumulative | 0 exact, 1 up to |
A2 |
3 |
Three rejections |
B2 |
2 |
Need two qualified customers |
C2 |
0.25 |
One-in-four independent qualification chance |
D2 |
0 |
Exact probability |
D3 |
1 |
Cumulative probability |
Place this formula in E2:
=NEGBINOM.DIST(A2;B2;C2;D2)
Expected output (the corresponding constant-input formula was natively observed): 0.10546875 (approximately 10.55%). In E3, enter =NEGBINOM.DIST(A2;B2;C2;D3); the result is 0.3671875 (approximately 36.72%). Both share the same number of failures and success target. Only the meaning of the Cumulative argument changes. The saved native tests used constant inputs; this exact cell-reference worksheet was not separately executed.
Important modeling assumptions: Each trial has two outcomes, independence, and a stable success probability. If chances change after each failure or outcomes depend on earlier trials, this model is not an exact representation of your process.
Understanding and checking the probability
For nonnegative integer X, positive integer R and per-trial success probability p, the probability mass function is:
P(X=x) = COMBIN(x + r - 1; r - 1) × p^r × (1 - p)^x
The factor COMBIN counts the sequences of preceding successes and failures before the last required success. Thus, the exact probability for three failures before two successes with a 25% success probability is:
=COMBIN(3+2-1;2-1)*0.25^2*(1-0.25)^3
Independently calculated and natively observed: 0.10546875, which agrees with =NEGBINOM.DIST(3;2;0.25;0). The cumulative value sums the mass for each allowed failure count from zero through X, inclusive. The combinatorial formula and the distribution formula were both recorded in the saved native tests.
Advanced recipes
Probability of exceeding a failure threshold
To find the probability that more than three failures will be needed before the second success, use the complement of the cumulative probability:
=1-NEGBINOM.DIST(3;2;0.25;1)
Native output: 0.6328125 (approximately 63.28%). This is the probability of four or more failures; it is not the probability of exactly four failures.
Probability of an inclusive interval of failure counts
For the chance of two through five failures, subtract the CDF for one failure from the CDF for five failures:
=NEGBINOM.DIST(5;2;0.25;1)-NEGBINOM.DIST(1;2;0.25;1)
Both CDF terms include their upper endpoints. Subtracting the CDF at 1 therefore retains outcomes 2, 3, 4, 5. Do not substitute the CDF at the lower endpoint 2 or you would exclude 2 as well. To obtain the interval probability when the lower bound is zero, use the upper CDF alone; negative X was rejected during native testing.
Using cell references and switching calculation mode
Set A2 to failures, B2 to successes, C2 to the probability of success, and D2 to 0 or 1. The formula
=NEGBINOM.DIST(A2;B2;C2;D2)
can be filled down a table to compare different candidate failure thresholds. Keep the probability and success target constant when comparing a cumulative distribution by threshold. =NEGBINOM.DIST(A2;$B$2;$C$2;1) fixes those parameters so the formula can be filled down a column of X values. $ absolute references protect the target and probability from shifting.
Compare the legacy Calc name
LibreOffice also documents NEGBINOMDIST(X;R;SP) with three required parameters. In the same native Calc environment,
=NEGBINOMDIST(3;2;0.25)
returned 0.10546875, the same exact probability as NEGBINOM.DIST(3;2;0.25;0). The two function names are related but their argument signatures are not interchangeable: the legacy three-argument name has no cumulative parameter. LibreOffice documentation for both forms, accessed 2026-10-12.
Errors, boundaries, and troubleshooting
| Symptom | Likely cause | Correction / confidence |
|---|---|---|
Err:511 with only three arguments |
Missing required Cumulative |
Provide 0 or 1. Natively observed in Calc 25.2.3.2. |
Err:502 |
X is negative or R is zero |
Require X >= 0 and R >= 1. Natively observed in Calc 25.2.3.2. |
Err:502 |
Probability outside [0, 1] |
Supply a fraction like 0.25, not 25 to mean 25%. Natively observed in this test set. |
Err:519 / #VALUE! or other input error |
Incompatible text or formula input | Inspect typed input and cell value; exact displayed error can depend on type, locale and version. See native diagnostics for observed code. |
| Probability much too low | Swapped failures/successes or entered 25 instead of 0.25 |
Check argument order and success probability. |
| Unexpected cumulative probability | Used mode 0 instead of 1, or confused success count with failure count |
Set mode explicitly and label the measurement. |
| Formula name not accepted | Function translation, older installation or wrong formula separator | Use English names in Formula Options and confirm the supported Calc version. |
Input notes: LibreOffice Help describes X as the unsuccessful-test count, R as successful-test count, SP as the probability, and the fourth parameter as 0 versus 1; the reference does not supply a default cumulative value. In Calc 25.2.3.2, decimal X=2.9 and R=2.8 were truncated to the integer counts 2 and 2 in an observed test (0.1875), rather than treated as a separate fractional-trial model. To avoid ambiguity, use whole-number inputs for counts; do not rely on coercion portability. At SP=0, the saved tests return zero for every tested finite failure threshold because the success target cannot be reached. At SP=1, zero failures has probability one and positive failures have probability zero. For the ordinary waiting-time model use 0<SP<=1; the zero-success boundary is not a finite waiting-time distribution.
For numeric inputs, a proposed validation helper is:
=IF(OR(A2<0;B2<1;C2<0;C2>1);"Check inputs";NEGBINOM.DIST(A2;B2;C2;0))
This guard was not separately native executed. It checks numeric bounds only; it is not a complete test for blanks, text, or integer-only requirements. Use ISNUMBER and INT checks when importing unknown datasets, and never silently clamp real measurements just to suppress an error.
Compatibility: other spreadsheet software
| Program | Documented counterpart | Important difference | Verification method |
|---|---|---|---|
| LibreOffice Calc | NEGBINOM.DIST(X;R;SP;Cumulative) |
Semicolon separator in displayed English examples; older NEGBINOMDIST(X;R;SP) has three parameters |
Native execution: Calc 25.2.3.2, plus official 26.8 Help |
| Microsoft Excel | NEGBINOM.DIST(number_f,number_s,probability_s,cumulative) |
Commas in English examples; same conceptual PMF/CDF distinction | Official Excel documentation only; Excel not executed |
| Google Sheets | NEGBINOMDIST(num_failures,num_successes,prob_success,cumulative) |
Google’s documented spelling is NEGBINOMDIST with four parameters, unlike Calc’s legacy three-parameter function of that spelling | Official Google documentation only; Sheets not executed |
For Excel see Microsoft’s NEGBINOM.DIST documentation; for Sheets see Google’s NEGBINOMDIST documentation. Both were checked on 2026-10-12. Compatibility with other spreadsheet programs, regional separators and older editions has not been natively tested here; do not infer support from this table.
Related tutorials and further reading
- BINOM.DIST in LibreOffice Calc — counts successes out of a fixed number of trials; contrast with counting failures until a fixed number of successes.
- The older
NEGBINOMDISTis documented in the same LibreOffice Statistical Functions reference..
Official references and test scope
- LibreOffice 26.8 Help — Statistical Functions Part Four, section NEGBINOM.DIST and NEGBINOMDIST, accessed 2026-10-12. Supports syntax, arguments, documentation examples, version-added and function namespace. Help is 26.8 at time of access, whereas native tests ran on 25.2.3.2.
- LibreOffice Help — Formula Options, accessed 2026-10-12. Supports names/separators settings.
- Microsoft Support — NEGBINOM.DIST, accessed 2026-10-12. Documentation-only compatibility comparison.
- Google Docs Editors Help — NEGBINOMDIST, accessed 2026-10-12. Documentation-only compatibility comparison.