HYPGEOMDIST
Quirk foundCategory: Compatibility · Last tested 2026-09-01
Real compatibility results for the HYPGEOMDIST function: executed in Excel for the web, Google Sheets and LibreOffice Calc, with desktop Excel behavior from Microsoft’s official documentation (we do not run desktop Excel — Excel for the web is a different application and is executed separately). Syntax and links to that documentation are below.
Support matrix
| Engine | Documented | Live-tested | Verdict |
|---|---|---|---|
| Excel (desktop) | Yes | No — documented only | n/a |
| Excel for the web | — | Yes (recalc, 2026-09-01) | Quirk found |
| Google Sheets | Yes | Yes (Drive import, 2026-08-31) | Quirk found |
| LibreOffice Calc | Yes | Yes (25.8.7.3, 2026-08-31) | Quirk found |
LibreOffice version history
We executed the same test cases under each LibreOffice release to show exactly when HYPGEOMDIST’s support changed — not documentation claims, real results.
| LibreOffice version | Verdict | Tested |
|---|---|---|
| 24.2.0.3 | Quirk found | 2026-08-31 |
| 24.8.7.2 | Quirk found | 2026-08-31 |
| 25.2.0.3 | Quirk found | 2026-08-31 |
| 25.8.7.3 | Quirk found | 2026-08-31 |
Why isn't HYPGEOMDIST working in LibreOffice?
HYPGEOMDIST exists in LibreOffice 25.8.7.3, but it is not a drop-in match for
Excel — our executed tests found real behavioral differences (detailed in the test results on this
page). If a formula that works in Excel or Google Sheets misbehaves in LibreOffice, compare your usage
against the failing cases above before assuming your data is wrong.
Why isn’t HYPGEOMDIST working in Google Sheets?
HYPGEOMDIST runs in Google Sheets, but our executed cases show it does not match
Excel’s documented behavior on every input (the failing cases are listed on this page). If a
formula that behaves one way in Excel gives you a different answer in Sheets, compare your usage
against those cases before assuming your data is wrong.
Discovered quirks
-
=HYPGEOMDIST(5,4,8,20) on
Excel for the web returned
0, but the documented/expected
result is #NUM!.
Provenance
Excel documents: "If sample_s < 0 or sample_s is greater than the lesser of number_sample or population_s, HYPGEOMDIST returns the #NUM! error value." EXECUTED RESULT: all four LibreOffice builds (24.2.0.3, 24.8.7.2, 25.2.0.3, 25.8.7.3) return #VALUE! here instead of the documented #NUM! -- the same systemic #VALUE!-substitution pattern already recorded across this corpus, an error-code difference rather than a computation one. Set up from Microsoft's own worked-example table: A2 = 1 (number of successes in the sample), A3 = 4 (sample size), A4 = 8 (number of successes in the population) and A5 = 20 (population size), pasted at A1 as the page describes. Column F is untouched because this harness writes the formula under test into cell F1.; MISMATCH vs expected: expected '#NUM!', got 0
-
=HYPGEOMDIST(1,0,8,20) on
Excel for the web returned
0, but the documented/expected
result is #NUM!.
Provenance
Excel documents: "If number_sample <= 0 or number_sample > number_population, HYPGEOMDIST returns the #NUM! error value." EXECUTED RESULT: all four LibreOffice builds (24.2.0.3, 24.8.7.2, 25.2.0.3, 25.8.7.3) return #VALUE! here instead of the documented #NUM! -- the same systemic #VALUE!-substitution pattern already recorded across this corpus, an error-code difference rather than a computation one. Set up from Microsoft's own worked-example table: A2 = 1 (number of successes in the sample), A3 = 4 (sample size), A4 = 8 (number of successes in the population) and A5 = 20 (population size), pasted at A1 as the page describes. Column F is untouched because this harness writes the formula under test into cell F1.; MISMATCH vs expected: expected '#NUM!', got 0
-
=ROUND(HYPGEOMDIST(1.9,4.9,8.9,20.9),12) on
Google Sheets returned
0.2724458204, but the documented/expected
result is 0.363261093911.
Provenance
Excel documents, as the first remark on the page: "All arguments are truncated to integers." Truncation (toward zero), not rounding: 1.9, 4.9, 8.9, 20.9 must become 1, 4, 8, 20 and reproduce the documented example's answer exactly. Chosen with fractional parts of .9 precisely so that an engine which ROUNDS instead of truncating gets 2, 5, 9, 21 and a visibly different number (0.4067...), rather than accidentally passing. Set up from Microsoft's own worked-example table: A2 = 1 (number of successes in the sample), A3 = 4 (sample size), A4 = 8 (number of successes in the population) and A5 = 20 (population size), pasted at A1 as the page describes. Column F is untouched because this harness writes the formula under test into cell F1.; MISMATCH vs expected: expected 0.363261093911, got 0.2724458204
-
=HYPGEOMDIST(5,4,8,20) on
LibreOffice Calc returned
#VALUE!, but the documented/expected
result is #NUM!.
Provenance
Excel documents: "If sample_s < 0 or sample_s is greater than the lesser of number_sample or population_s, HYPGEOMDIST returns the #NUM! error value." EXECUTED RESULT: all four LibreOffice builds (24.2.0.3, 24.8.7.2, 25.2.0.3, 25.8.7.3) return #VALUE! here instead of the documented #NUM! -- the same systemic #VALUE!-substitution pattern already recorded across this corpus, an error-code difference rather than a computation one. Set up from Microsoft's own worked-example table: A2 = 1 (number of successes in the sample), A3 = 4 (sample size), A4 = 8 (number of successes in the population) and A5 = 20 (population size), pasted at A1 as the page describes. Column F is untouched because this harness writes the formula under test into cell F1.; MISMATCH vs expected: expected '#NUM!', got '#VALUE!'
-
=HYPGEOMDIST(1,0,8,20) on
LibreOffice Calc returned
#VALUE!, but the documented/expected
result is #NUM!.
Provenance
Excel documents: "If number_sample <= 0 or number_sample > number_population, HYPGEOMDIST returns the #NUM! error value." EXECUTED RESULT: all four LibreOffice builds (24.2.0.3, 24.8.7.2, 25.2.0.3, 25.8.7.3) return #VALUE! here instead of the documented #NUM! -- the same systemic #VALUE!-substitution pattern already recorded across this corpus, an error-code difference rather than a computation one. Set up from Microsoft's own worked-example table: A2 = 1 (number of successes in the sample), A3 = 4 (sample size), A4 = 8 (number of successes in the population) and A5 = 20 (population size), pasted at A1 as the page describes. Column F is untouched because this harness writes the formula under test into cell F1.; MISMATCH vs expected: expected '#NUM!', got '#VALUE!'
Executed test cases
Excel for the web (executed 2026-09-01 via OneDrive recalculation)
These values come from Excel for the web, not from desktop Excel. They are two different implementations of the calculation engine, and this run measured only the web one: the corpus was uploaded to OneDrive as .xlsx, recalculated by Excel for the web on open, and downloaded again for readback. Excel for the web is a rolling service with no pinnable version, so the run is identified by its date. Where a value here disagrees with the Expected column — which is Microsoft’s documentation of the desktop product — we cannot tell you whether the web engine diverges from the desktop one or the documentation is wrong about both, because we do not run desktop Excel.
| Formula | Description | Result | Expected | Verdict |
|---|---|---|---|---|
| =ROUND(HYPGEOMDIST(A2,A3,A4,A5),12) | Microsoft's documented worked example: the hypergeometric probability | 0.363261093911 | 0.363261093911ProvenanceMicrosoft publishes '=HYPGEOMDIST(A2,A3,A4,A5)' with the result 0.3633. Derived independently from the equation the page states -- P(X = x) = C(M,x)*C(N-M,n-x)/C(N,n) with x = sample_s, n = number_sample, M = population_s, N = number_pop -- evaluated in exact rational arithmetic from binomial coefficients rather than from any statistics library's hypergeometric routine: C(8,1)*C(12,3)/C(20,4) = 8*220/4845 = 1760/4845 = 0.36326109391124871001, and C(8,0)*C(12,4)/C(20,4) = 495/4845 = 0.10216718266253869969. The mass at x = 1 is 1760/4845 = 0.36326109391124871001, which rounds to exactly the published 0.3633. The legacy function has no cumulative argument, so this single mass is its whole contract; it must agree with HYPGEOM.DIST(...,FALSE) on the same data, which the corpus asserts on that function's page. Set up from Microsoft's own worked-example table: A2 = 1 (number of successes in the sample), A3 = 4 (sample size), A4 = 8 (number of successes in the population) and A5 = 20 (population size), pasted at A1 as the page describes. Column F is untouched because this harness writes the formula under test into cell F1. |
Matched |
| =ROUND(HYPGEOMDIST(1.9,4.9,8.9,20.9),12) | All four arguments given fractionally, to test the documented truncation | 0.363261093911 | 0.363261093911ProvenanceExcel documents, as the first remark on the page: "All arguments are truncated to integers." Truncation (toward zero), not rounding: 1.9, 4.9, 8.9, 20.9 must become 1, 4, 8, 20 and reproduce the documented example's answer exactly. Chosen with fractional parts of .9 precisely so that an engine which ROUNDS instead of truncating gets 2, 5, 9, 21 and a visibly different number (0.4067...), rather than accidentally passing. Set up from Microsoft's own worked-example table: A2 = 1 (number of successes in the sample), A3 = 4 (sample size), A4 = 8 (number of successes in the population) and A5 = 20 (population size), pasted at A1 as the page describes. Column F is untouched because this harness writes the formula under test into cell F1. |
Matched |
| =ROUND(HYPGEOMDIST(0,4,8,20),12) | The probability of drawing no successes at all | 0.102167182663 | 0.102167182663ProvenanceNot published; derived in exact rational arithmetic from the same documented equation: C(8,0)*C(12,4)/C(20,4) = 1*495/4845 = 0.10216718266253869969. Included because 0 is a legal sample_s (the page excludes only sample_s < 0) that sits exactly on the boundary of the exclusion, and because C(M,0) = 1 is where a binomial-coefficient routine written as a product loop is most likely to slip. Set up from Microsoft's own worked-example table: A2 = 1 (number of successes in the sample), A3 = 4 (sample size), A4 = 8 (number of successes in the population) and A5 = 20 (population size), pasted at A1 as the page describes. Column F is untouched because this harness writes the formula under test into cell F1. |
Matched |
| =HYPGEOMDIST(5,4,8,20) | sample_s larger than the sample size | 0 | #NUM!ProvenanceExcel documents: "If sample_s < 0 or sample_s is greater than the lesser of number_sample or population_s, HYPGEOMDIST returns the #NUM! error value." EXECUTED RESULT: all four LibreOffice builds (24.2.0.3, 24.8.7.2, 25.2.0.3, 25.8.7.3) return #VALUE! here instead of the documented #NUM! -- the same systemic #VALUE!-substitution pattern already recorded across this corpus, an error-code difference rather than a computation one. Set up from Microsoft's own worked-example table: A2 = 1 (number of successes in the sample), A3 = 4 (sample size), A4 = 8 (number of successes in the population) and A5 = 20 (population size), pasted at A1 as the page describes. Column F is untouched because this harness writes the formula under test into cell F1. |
Mismatch |
| =HYPGEOMDIST(1,0,8,20) | A sample size of zero | 0 | #NUM!ProvenanceExcel documents: "If number_sample <= 0 or number_sample > number_population, HYPGEOMDIST returns the #NUM! error value." EXECUTED RESULT: all four LibreOffice builds (24.2.0.3, 24.8.7.2, 25.2.0.3, 25.8.7.3) return #VALUE! here instead of the documented #NUM! -- the same systemic #VALUE!-substitution pattern already recorded across this corpus, an error-code difference rather than a computation one. Set up from Microsoft's own worked-example table: A2 = 1 (number of successes in the sample), A3 = 4 (sample size), A4 = 8 (number of successes in the population) and A5 = 20 (population size), pasted at A1 as the page describes. Column F is untouched because this harness writes the formula under test into cell F1. |
Mismatch |
| =HYPGEOMDIST("a",4,8,20) | A non-numeric argument | #VALUE! | #VALUE!ProvenanceExcel documents: "If any argument is nonnumeric, HYPGEOMDIST returns the #VALUE! error value." Set up from Microsoft's own worked-example table: A2 = 1 (number of successes in the sample), A3 = 4 (sample size), A4 = 8 (number of successes in the population) and A5 = 20 (population size), pasted at A1 as the page describes. Column F is untouched because this harness writes the formula under test into cell F1. |
Matched |
Google Sheets (executed 2026-08-31 via Drive import)
Google Sheets is a rolling service with no pinnable version, so this run is identified by its date. The corpus was imported to Drive as .xlsx, recalculated by Sheets, and exported back for readback.
| Formula | Description | Result | Expected | Verdict |
|---|---|---|---|---|
| =ROUND(HYPGEOMDIST(A2,A3,A4,A5),12) | Microsoft's documented worked example: the hypergeometric probability | 0.3632610939 | 0.363261093911ProvenanceMicrosoft publishes '=HYPGEOMDIST(A2,A3,A4,A5)' with the result 0.3633. Derived independently from the equation the page states -- P(X = x) = C(M,x)*C(N-M,n-x)/C(N,n) with x = sample_s, n = number_sample, M = population_s, N = number_pop -- evaluated in exact rational arithmetic from binomial coefficients rather than from any statistics library's hypergeometric routine: C(8,1)*C(12,3)/C(20,4) = 8*220/4845 = 1760/4845 = 0.36326109391124871001, and C(8,0)*C(12,4)/C(20,4) = 495/4845 = 0.10216718266253869969. The mass at x = 1 is 1760/4845 = 0.36326109391124871001, which rounds to exactly the published 0.3633. The legacy function has no cumulative argument, so this single mass is its whole contract; it must agree with HYPGEOM.DIST(...,FALSE) on the same data, which the corpus asserts on that function's page. Set up from Microsoft's own worked-example table: A2 = 1 (number of successes in the sample), A3 = 4 (sample size), A4 = 8 (number of successes in the population) and A5 = 20 (population size), pasted at A1 as the page describes. Column F is untouched because this harness writes the formula under test into cell F1. |
Matched |
| =ROUND(HYPGEOMDIST(1.9,4.9,8.9,20.9),12) | All four arguments given fractionally, to test the documented truncation | 0.2724458204 | 0.363261093911ProvenanceExcel documents, as the first remark on the page: "All arguments are truncated to integers." Truncation (toward zero), not rounding: 1.9, 4.9, 8.9, 20.9 must become 1, 4, 8, 20 and reproduce the documented example's answer exactly. Chosen with fractional parts of .9 precisely so that an engine which ROUNDS instead of truncating gets 2, 5, 9, 21 and a visibly different number (0.4067...), rather than accidentally passing. Set up from Microsoft's own worked-example table: A2 = 1 (number of successes in the sample), A3 = 4 (sample size), A4 = 8 (number of successes in the population) and A5 = 20 (population size), pasted at A1 as the page describes. Column F is untouched because this harness writes the formula under test into cell F1. |
Mismatch |
| =ROUND(HYPGEOMDIST(0,4,8,20),12) | The probability of drawing no successes at all | 0.1021671827 | 0.102167182663ProvenanceNot published; derived in exact rational arithmetic from the same documented equation: C(8,0)*C(12,4)/C(20,4) = 1*495/4845 = 0.10216718266253869969. Included because 0 is a legal sample_s (the page excludes only sample_s < 0) that sits exactly on the boundary of the exclusion, and because C(M,0) = 1 is where a binomial-coefficient routine written as a product loop is most likely to slip. Set up from Microsoft's own worked-example table: A2 = 1 (number of successes in the sample), A3 = 4 (sample size), A4 = 8 (number of successes in the population) and A5 = 20 (population size), pasted at A1 as the page describes. Column F is untouched because this harness writes the formula under test into cell F1. |
Matched |
| =HYPGEOMDIST(5,4,8,20) | sample_s larger than the sample size | #NUM! | #NUM!ProvenanceExcel documents: "If sample_s < 0 or sample_s is greater than the lesser of number_sample or population_s, HYPGEOMDIST returns the #NUM! error value." EXECUTED RESULT: all four LibreOffice builds (24.2.0.3, 24.8.7.2, 25.2.0.3, 25.8.7.3) return #VALUE! here instead of the documented #NUM! -- the same systemic #VALUE!-substitution pattern already recorded across this corpus, an error-code difference rather than a computation one. Set up from Microsoft's own worked-example table: A2 = 1 (number of successes in the sample), A3 = 4 (sample size), A4 = 8 (number of successes in the population) and A5 = 20 (population size), pasted at A1 as the page describes. Column F is untouched because this harness writes the formula under test into cell F1. |
Matched |
| =HYPGEOMDIST(1,0,8,20) | A sample size of zero | #NUM! | #NUM!ProvenanceExcel documents: "If number_sample <= 0 or number_sample > number_population, HYPGEOMDIST returns the #NUM! error value." EXECUTED RESULT: all four LibreOffice builds (24.2.0.3, 24.8.7.2, 25.2.0.3, 25.8.7.3) return #VALUE! here instead of the documented #NUM! -- the same systemic #VALUE!-substitution pattern already recorded across this corpus, an error-code difference rather than a computation one. Set up from Microsoft's own worked-example table: A2 = 1 (number of successes in the sample), A3 = 4 (sample size), A4 = 8 (number of successes in the population) and A5 = 20 (population size), pasted at A1 as the page describes. Column F is untouched because this harness writes the formula under test into cell F1. |
Matched |
| =HYPGEOMDIST("a",4,8,20) | A non-numeric argument | #VALUE! | #VALUE!ProvenanceExcel documents: "If any argument is nonnumeric, HYPGEOMDIST returns the #VALUE! error value." Set up from Microsoft's own worked-example table: A2 = 1 (number of successes in the sample), A3 = 4 (sample size), A4 = 8 (number of successes in the population) and A5 = 20 (population size), pasted at A1 as the page describes. Column F is untouched because this harness writes the formula under test into cell F1. |
Matched |
LibreOffice Calc 25.8.7.3 (tested 2026-08-31)
| Formula | Description | Result | Expected | Verdict |
|---|---|---|---|---|
| =ROUND(HYPGEOMDIST(A2,A3,A4,A5),12) | Microsoft's documented worked example: the hypergeometric probability | 0.363261093911 | 0.363261093911ProvenanceMicrosoft publishes '=HYPGEOMDIST(A2,A3,A4,A5)' with the result 0.3633. Derived independently from the equation the page states -- P(X = x) = C(M,x)*C(N-M,n-x)/C(N,n) with x = sample_s, n = number_sample, M = population_s, N = number_pop -- evaluated in exact rational arithmetic from binomial coefficients rather than from any statistics library's hypergeometric routine: C(8,1)*C(12,3)/C(20,4) = 8*220/4845 = 1760/4845 = 0.36326109391124871001, and C(8,0)*C(12,4)/C(20,4) = 495/4845 = 0.10216718266253869969. The mass at x = 1 is 1760/4845 = 0.36326109391124871001, which rounds to exactly the published 0.3633. The legacy function has no cumulative argument, so this single mass is its whole contract; it must agree with HYPGEOM.DIST(...,FALSE) on the same data, which the corpus asserts on that function's page. Set up from Microsoft's own worked-example table: A2 = 1 (number of successes in the sample), A3 = 4 (sample size), A4 = 8 (number of successes in the population) and A5 = 20 (population size), pasted at A1 as the page describes. Column F is untouched because this harness writes the formula under test into cell F1. |
Matched |
| =ROUND(HYPGEOMDIST(1.9,4.9,8.9,20.9),12) | All four arguments given fractionally, to test the documented truncation | 0.363261093911 | 0.363261093911ProvenanceExcel documents, as the first remark on the page: "All arguments are truncated to integers." Truncation (toward zero), not rounding: 1.9, 4.9, 8.9, 20.9 must become 1, 4, 8, 20 and reproduce the documented example's answer exactly. Chosen with fractional parts of .9 precisely so that an engine which ROUNDS instead of truncating gets 2, 5, 9, 21 and a visibly different number (0.4067...), rather than accidentally passing. Set up from Microsoft's own worked-example table: A2 = 1 (number of successes in the sample), A3 = 4 (sample size), A4 = 8 (number of successes in the population) and A5 = 20 (population size), pasted at A1 as the page describes. Column F is untouched because this harness writes the formula under test into cell F1. |
Matched |
| =ROUND(HYPGEOMDIST(0,4,8,20),12) | The probability of drawing no successes at all | 0.102167182663 | 0.102167182663ProvenanceNot published; derived in exact rational arithmetic from the same documented equation: C(8,0)*C(12,4)/C(20,4) = 1*495/4845 = 0.10216718266253869969. Included because 0 is a legal sample_s (the page excludes only sample_s < 0) that sits exactly on the boundary of the exclusion, and because C(M,0) = 1 is where a binomial-coefficient routine written as a product loop is most likely to slip. Set up from Microsoft's own worked-example table: A2 = 1 (number of successes in the sample), A3 = 4 (sample size), A4 = 8 (number of successes in the population) and A5 = 20 (population size), pasted at A1 as the page describes. Column F is untouched because this harness writes the formula under test into cell F1. |
Matched |
| =HYPGEOMDIST(5,4,8,20) | sample_s larger than the sample size | #VALUE! | #NUM!ProvenanceExcel documents: "If sample_s < 0 or sample_s is greater than the lesser of number_sample or population_s, HYPGEOMDIST returns the #NUM! error value." EXECUTED RESULT: all four LibreOffice builds (24.2.0.3, 24.8.7.2, 25.2.0.3, 25.8.7.3) return #VALUE! here instead of the documented #NUM! -- the same systemic #VALUE!-substitution pattern already recorded across this corpus, an error-code difference rather than a computation one. Set up from Microsoft's own worked-example table: A2 = 1 (number of successes in the sample), A3 = 4 (sample size), A4 = 8 (number of successes in the population) and A5 = 20 (population size), pasted at A1 as the page describes. Column F is untouched because this harness writes the formula under test into cell F1. |
Mismatch |
| =HYPGEOMDIST(1,0,8,20) | A sample size of zero | #VALUE! | #NUM!ProvenanceExcel documents: "If number_sample <= 0 or number_sample > number_population, HYPGEOMDIST returns the #NUM! error value." EXECUTED RESULT: all four LibreOffice builds (24.2.0.3, 24.8.7.2, 25.2.0.3, 25.8.7.3) return #VALUE! here instead of the documented #NUM! -- the same systemic #VALUE!-substitution pattern already recorded across this corpus, an error-code difference rather than a computation one. Set up from Microsoft's own worked-example table: A2 = 1 (number of successes in the sample), A3 = 4 (sample size), A4 = 8 (number of successes in the population) and A5 = 20 (population size), pasted at A1 as the page describes. Column F is untouched because this harness writes the formula under test into cell F1. |
Mismatch |
| =HYPGEOMDIST("a",4,8,20) | A non-numeric argument | #VALUE! | #VALUE!ProvenanceExcel documents: "If any argument is nonnumeric, HYPGEOMDIST returns the #VALUE! error value." Set up from Microsoft's own worked-example table: A2 = 1 (number of successes in the sample), A3 = 4 (sample size), A4 = 8 (number of successes in the population) and A5 = 20 (population size), pasted at A1 as the page describes. Column F is untouched because this harness writes the formula under test into cell F1. |
Matched |
Docs & syntax
- Excel (desktop): official documentation
- Google Sheets: official documentation
- LibreOffice Calc: official documentation