HYPGEOMDIST Function (Gnumeric)
Calculate exact-count or cumulative sampling probabilities without replacement, with feasible counts and an optional cumulative selector.
Verification status: Original tables retain their Gnumeric 1.12.57 record. Their formulas and selected XLSX argument mappings were also recalculated with Gnumeric 1.12.62 using ssconvert on Linux, including cacheless re-import and input changes. No other spreadsheet application or graphical interface was tested. How formula examples are checked
Quick answer: =HYPGEOMDIST(2,4,8,20) gives approximately 0.381424148607.
Availability and version history
- Introduced: First release not established from the evidence cited here.
- Supported in: Gnumeric 1.12.62, confirmed by its function registration. No retirement is established.
- Scope: Desktop Gnumeric with the Statistics Functions plugin. Tables use English comma-separated formulas.
- Checked: The original October 14, 2026 tables record 1.12.57. On October 22, their formulas and the XLSX cases below were also recalculated in Gnumeric 1.12.62 / GOFFICE 0.10.61, Debian 13 x86-64, through the
ssconvertcommand-line tool, withC.UTF-8locale and UTC timezone. This is calculation and file-conversion evidence, not a graphical-interface test.
What the function calculates
HYPGEOMDIST models sampling without replacement from a finite population containing M successes and NāM failures. Its exact-count probability is COMBIN(M,x)ĆCOMBIN(NāM,nāx)/COMBIN(N,n). The draws are dependent because each selected item leaves the population; a binomial model instead assumes a constant probability across independent trials. Official function reference.
Syntax and arguments
=HYPGEOMDIST(x,n,M,N[,cumulative])
| Argument | Meaning |
|---|---|
| x | Successes in the sample. |
| n | Number drawn without replacement. |
| M | Successes in the full population. |
| N | Total population size. |
| cumulative | Optional; FALSE or omission gives exact-count mass, TRUE gives P(Xā¤x). |
Only bracketed arguments are optional; do not type the brackets. The version-pinned help and evaluator establish the Gnumeric contract.
Reproducible reference cases
The table records the tested releaseās outputs, with finite mathematical references rounded to twelve decimal places. Keep full precision when using a result in a later calculation.
| Formula | Result in Gnumeric 1.12.57, approximately |
|---|---|
=HYPGEOMDIST(0,4,8,20) |
0.102167182663 |
=HYPGEOMDIST(1,4,8,20) |
0.363261093911 |
=HYPGEOMDIST(2,4,8,20) |
0.381424148607 |
=HYPGEOMDIST(3,4,8,20) |
0.138699690402 |
=HYPGEOMDIST(4,4,8,20) |
0.014447884417 |
=HYPGEOMDIST(2,4,8,20,1) |
0.846852425181 |
=HYPGEOMDIST(0,0,8,20) |
1 |
=HYPGEOMDIST(1,2,3,5) |
0.6 |
Practical worksheet
Suppose a batch contains 20 parts, of which 8 have a marked property. Draw 4 without replacement. Put 2, 4, 8 and 20 in A2:D2 and enter =HYPGEOMDIST(A2,B2,C2,D2). The probability of exactly two marked parts is approximately 0.381424148607. Add TRUE() as the fifth argument to obtain the probability of at most two, approximately 0.846852425181. Define āsuccessā consistently before entering the counts; it can describe a defect or a desirable property.
Advanced examples and independent checks
For at least two marked parts, use =1-HYPGEOMDIST(1,4,8,20,TRUE()), approximately 0.534571723426. The complement removes zero and one, so subtracting the CDF at 2 would answer āat least threeā instead.
As a check, the first five exact-count probabilities in the table sum to 1. They cover all possibilities from zero through four marked parts. A binomial approximation with four trials and p=0.4 gives 0.3456 for exactly two, which differs from the finite-population result. COMBIN helps reconstruct the exact-count formula using integer combinations.
Input boundaries and common mistakes
All four counts are floored in the evaluator. Use integers with 0ā¤Mā¤N and 0ā¤nā¤N deliberately. Feasible x lies between max(0,nā(NāM)) and min(n,M). Some impossible success counts return zero, while invalid population relationships produce #NUM!; do not treat these as the same input condition. The optional fifth argument is a Gnumeric contract, not a reason to assume another program accepts it.
These additional outcomes were observed in the same native recalculation. F5 was genuinely empty; it is not an omitted argument. Missing inputs still need deliberate validation, even if they are converted to a numeric zero.
| Formula | Observed in 1.12.57 |
|---|---|
=HYPGEOMDIST(2.9,4.9,8.9,20.9) |
0.381424148607 |
=HYPGEOMDIST(5,4,8,20) |
0 |
=HYPGEOMDIST(0,4,8,10) |
0 |
=HYPGEOMDIST(1,2,6,5) |
#NUM! |
=HYPGEOMDIST(1,6,3,5) |
#NUM! |
=HYPGEOMDIST(F5,4,8,20) |
0.102167182663 |
The worked calculations do not certify every locale, imported text value, extreme parameter or later binary version. Shared numerical helpers can change even when a functionās wrapper remains the same.
XLSX compatibility: why an extra FALSE appears
When Gnumeric 1.12.62 saves these formulas to XLSX, the file uses the name _xlfn.HYPGEOM.DIST. A four-argument Gnumeric call also gains a fifth argument, FALSE, so that it still requests the probability of exactly x successes. An existing fifth argument is retained. This behavior is defined by the version-pinned XLSX export handler and name mapping.
With A2:D2 containing 2, 4, 8 and 20, the following were observed in the exported worksheet XML:
| Gnumeric formula | Formula stored in XLSX, without the leading equals sign | Result, approximately |
|---|---|---|
=HYPGEOMDIST(A2,B2,C2,D2) |
_xlfn.HYPGEOM.DIST(A2,B2,C2,D2,FALSE) |
0.381424148607 |
=HYPGEOMDIST(A2,B2,C2,D2,FALSE()) |
_xlfn.HYPGEOM.DIST(A2,B2,C2,D2,FALSE()) |
0.381424148607 |
=HYPGEOMDIST(A2,B2,C2,D2,TRUE()) |
_xlfn.HYPGEOM.DIST(A2,B2,C2,D2,TRUE()) |
0.846852425181 |
This table describes stored file syntax, not a formula to paste into every spreadsheet program. Re-importing that XLSX into the tested Gnumeric version restored the native HYPGEOMDIST name and recalculated the same results after cached answers were removed. The inserted FALSE can remain as an explicit fifth argument after re-import; that does not change the exact-count question.
To check your own round trip, keep the original Gnumeric workbook and work on a copy:
- Compare both the exact-count and cumulative formulas before and after saving and reopening the XLSX. Do not rely solely on an old displayed answer.
- Change A2 from 2 to 1. In the tested copy, the exact-count result changed to approximately 0.363261093911, and the cumulative result to 0.465428276574. Restore A2 to 2 to recover the original results.
- If the fifth argument points to a cell, check that reference too. With E2 set to TRUE,
=HYPGEOMDIST(A2,B2,C2,D2,E2)gave the cumulative result; changing E2 to FALSE gave the exact-count result. The exported formula retainedE2, rather than freezing its old value.
If a receiving program reports an unknown function or produces a different result, check its supported function name and cumulative-argument rules before changing the formula. Removing or changing the selector can change the probability being asked for. These checks establish Gnumeric’s own export and re-import behavior only. They do not establish calculation support in Excel, Calc, Google Sheets or another receiving application.
Sources and verification
The reference and boundary tables preserve the recorded 1.12.57 results. The later 1.12.62 CLI check recalculated those formulas, the at-least-two complement, and the added file-conversion cases. Expected probabilities were independently calculated with exact integer combinations and rational arithmetic. Formula caches were removed before the initial native calculation and the XLSX re-import; changing inputs and restoring them checked that results were live. No new application screenshot or public download is claimed here.