HYPGEOM.DIST
Quirk foundCategory: Statistical · Last tested 2026-09-01
Real compatibility results for the HYPGEOM.DIST 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) | Supported, behaves as documented |
| 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 HYPGEOM.DIST’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 HYPGEOM.DIST working in LibreOffice?
HYPGEOM.DIST 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.
Discovered quirks
-
=HYPGEOM.DIST(5,4,8,20,TRUE) on
Excel for the web returned
1, 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, HYPGEOM.DIST returns the #NUM! error value." 5 successes cannot occur in a sample of 4. 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 1
-
=HYPGEOM.DIST(5,4,8,20,TRUE) 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, HYPGEOM.DIST returns the #NUM! error value." 5 successes cannot occur in a sample of 4. 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!'
-
=HYPGEOM.DIST(1,25,8,20,TRUE) on
LibreOffice Calc returned
#VALUE!, but the documented/expected
result is #NUM!.
Provenance
Excel documents: "If number_sample <= 0 or number_sample > number_population, HYPGEOM.DIST returns the #NUM! error value." Sampling 25 items without replacement from a population of 20 is impossible. 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!'
-
=HYPGEOM.DIST(1,4,25,20,TRUE) on
LibreOffice Calc returned
#VALUE!, but the documented/expected
result is #NUM!.
Provenance
Excel documents: "If population_s <= 0 or population_s > number_population, HYPGEOM.DIST 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!'
-
=HYPGEOM.DIST(1,4,8,0,TRUE) on
LibreOffice Calc returned
#VALUE!, but the documented/expected
result is #NUM!.
Provenance
Excel documents: "If number_pop <= 0, HYPGEOM.DIST 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(HYPGEOM.DIST(A2,A3,A4,A5,TRUE),12) | Microsoft's documented worked example: the cumulative hypergeometric distribution | 0.465428276574 | 0.465428276574ProvenanceMicrosoft publishes '=HYPGEOM.DIST(A2,A3,A4,A5,TRUE)' with the result 0.4654. 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 cumulative value is the sum of those two probability masses (x = 0 and x = 1), 2255/4845 = 0.4654282765737874097, which rounds to exactly the published 0.4654. Asserting the cumulative form alongside the mass form is the point of the modern name: HYPGEOM.DIST's whole reason for existing over HYPGEOMDIST is the cumulative argument. 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(HYPGEOM.DIST(A2,A3,A4,A5,FALSE),12) | Microsoft's documented worked example: the probability mass function | 0.363261093911 | 0.363261093911ProvenanceMicrosoft publishes '=HYPGEOM.DIST(A2,A3,A4,A5,FALSE)' 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, and is the same value the legacy HYPGEOMDIST page publishes for the identical data. 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(HYPGEOM.DIST(4,4,8,20,TRUE),12) | The cumulative distribution at the largest attainable x must be exactly 1 | 1 | 1ProvenanceNot published; derived from the definition. With a sample of 4 drawn from a population of 20 containing 8 successes, x ranges over 0..4, so the cumulative probability at x = 4 is the total mass and equals 1. In exact rational arithmetic the five masses are 495/4845, 1760/4845, 1848/4845, 672/4845 and 70/4845, which sum to 4845/4845 = 1 exactly. A good test of a cumulative implementation: summation errors and off-by-one loop bounds both show up here as a value near but not equal to 1. 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 |
| =HYPGEOM.DIST(5,4,8,20,TRUE) | sample_s larger than the sample size | 1 | #NUM!ProvenanceExcel documents: "If sample_s < 0 or sample_s is greater than the lesser of number_sample or population_s, HYPGEOM.DIST returns the #NUM! error value." 5 successes cannot occur in a sample of 4. 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 |
| =HYPGEOM.DIST(1,25,8,20,TRUE) | A sample larger than the population | #NUM! | #NUM!ProvenanceExcel documents: "If number_sample <= 0 or number_sample > number_population, HYPGEOM.DIST returns the #NUM! error value." Sampling 25 items without replacement from a population of 20 is impossible. 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 |
| =HYPGEOM.DIST(1,4,25,20,TRUE) | More successes in the population than there are members of it | #NUM! | #NUM!ProvenanceExcel documents: "If population_s <= 0 or population_s > number_population, HYPGEOM.DIST 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 |
| =HYPGEOM.DIST(1,4,8,0,TRUE) | A population size of zero | #NUM! | #NUM!ProvenanceExcel documents: "If number_pop <= 0, HYPGEOM.DIST 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 |
| =HYPGEOM.DIST("a",4,8,20,TRUE) | A non-numeric argument | #VALUE! | #VALUE!ProvenanceExcel documents: "If any argument is nonnumeric, HYPGEOM.DIST 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(HYPGEOM.DIST(A2,A3,A4,A5,TRUE),12) | Microsoft's documented worked example: the cumulative hypergeometric distribution | 0.4654282766 | 0.465428276574ProvenanceMicrosoft publishes '=HYPGEOM.DIST(A2,A3,A4,A5,TRUE)' with the result 0.4654. 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 cumulative value is the sum of those two probability masses (x = 0 and x = 1), 2255/4845 = 0.4654282765737874097, which rounds to exactly the published 0.4654. Asserting the cumulative form alongside the mass form is the point of the modern name: HYPGEOM.DIST's whole reason for existing over HYPGEOMDIST is the cumulative argument. 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(HYPGEOM.DIST(A2,A3,A4,A5,FALSE),12) | Microsoft's documented worked example: the probability mass function | 0.3632610939 | 0.363261093911ProvenanceMicrosoft publishes '=HYPGEOM.DIST(A2,A3,A4,A5,FALSE)' 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, and is the same value the legacy HYPGEOMDIST page publishes for the identical data. 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(HYPGEOM.DIST(4,4,8,20,TRUE),12) | The cumulative distribution at the largest attainable x must be exactly 1 | 1 | 1ProvenanceNot published; derived from the definition. With a sample of 4 drawn from a population of 20 containing 8 successes, x ranges over 0..4, so the cumulative probability at x = 4 is the total mass and equals 1. In exact rational arithmetic the five masses are 495/4845, 1760/4845, 1848/4845, 672/4845 and 70/4845, which sum to 4845/4845 = 1 exactly. A good test of a cumulative implementation: summation errors and off-by-one loop bounds both show up here as a value near but not equal to 1. 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 |
| =HYPGEOM.DIST(5,4,8,20,TRUE) | 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, HYPGEOM.DIST returns the #NUM! error value." 5 successes cannot occur in a sample of 4. 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 |
| =HYPGEOM.DIST(1,25,8,20,TRUE) | A sample larger than the population | #NUM! | #NUM!ProvenanceExcel documents: "If number_sample <= 0 or number_sample > number_population, HYPGEOM.DIST returns the #NUM! error value." Sampling 25 items without replacement from a population of 20 is impossible. 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 |
| =HYPGEOM.DIST(1,4,25,20,TRUE) | More successes in the population than there are members of it | #NUM! | #NUM!ProvenanceExcel documents: "If population_s <= 0 or population_s > number_population, HYPGEOM.DIST 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 |
| =HYPGEOM.DIST(1,4,8,0,TRUE) | A population size of zero | #NUM! | #NUM!ProvenanceExcel documents: "If number_pop <= 0, HYPGEOM.DIST 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 |
| =HYPGEOM.DIST("a",4,8,20,TRUE) | A non-numeric argument | #VALUE! | #VALUE!ProvenanceExcel documents: "If any argument is nonnumeric, HYPGEOM.DIST 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(HYPGEOM.DIST(A2,A3,A4,A5,TRUE),12) | Microsoft's documented worked example: the cumulative hypergeometric distribution | 0.465428276574 | 0.465428276574ProvenanceMicrosoft publishes '=HYPGEOM.DIST(A2,A3,A4,A5,TRUE)' with the result 0.4654. 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 cumulative value is the sum of those two probability masses (x = 0 and x = 1), 2255/4845 = 0.4654282765737874097, which rounds to exactly the published 0.4654. Asserting the cumulative form alongside the mass form is the point of the modern name: HYPGEOM.DIST's whole reason for existing over HYPGEOMDIST is the cumulative argument. 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(HYPGEOM.DIST(A2,A3,A4,A5,FALSE),12) | Microsoft's documented worked example: the probability mass function | 0.363261093911 | 0.363261093911ProvenanceMicrosoft publishes '=HYPGEOM.DIST(A2,A3,A4,A5,FALSE)' 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, and is the same value the legacy HYPGEOMDIST page publishes for the identical data. 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(HYPGEOM.DIST(4,4,8,20,TRUE),12) | The cumulative distribution at the largest attainable x must be exactly 1 | 1 | 1ProvenanceNot published; derived from the definition. With a sample of 4 drawn from a population of 20 containing 8 successes, x ranges over 0..4, so the cumulative probability at x = 4 is the total mass and equals 1. In exact rational arithmetic the five masses are 495/4845, 1760/4845, 1848/4845, 672/4845 and 70/4845, which sum to 4845/4845 = 1 exactly. A good test of a cumulative implementation: summation errors and off-by-one loop bounds both show up here as a value near but not equal to 1. 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 |
| =HYPGEOM.DIST(5,4,8,20,TRUE) | 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, HYPGEOM.DIST returns the #NUM! error value." 5 successes cannot occur in a sample of 4. 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 |
| =HYPGEOM.DIST(1,25,8,20,TRUE) | A sample larger than the population | #VALUE! | #NUM!ProvenanceExcel documents: "If number_sample <= 0 or number_sample > number_population, HYPGEOM.DIST returns the #NUM! error value." Sampling 25 items without replacement from a population of 20 is impossible. 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 |
| =HYPGEOM.DIST(1,4,25,20,TRUE) | More successes in the population than there are members of it | #VALUE! | #NUM!ProvenanceExcel documents: "If population_s <= 0 or population_s > number_population, HYPGEOM.DIST 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 |
| =HYPGEOM.DIST(1,4,8,0,TRUE) | A population size of zero | #VALUE! | #NUM!ProvenanceExcel documents: "If number_pop <= 0, HYPGEOM.DIST 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 |
| =HYPGEOM.DIST("a",4,8,20,TRUE) | A non-numeric argument | #VALUE! | #VALUE!ProvenanceExcel documents: "If any argument is nonnumeric, HYPGEOM.DIST 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
Where HYPGEOM.DIST behaves differently
- Every error code LibreOffice reports as #VALUE!
Across our 2,334-case executed corpus, 272 cases in 135 functions return #VALUE! in LibreOffice Calc 25.8.7.3 where Microsoft documents #NUM! (244), #N/A (15), #DIV/0! (10) or #REF! (3). Google Sheets returns the documented code on 239 of the 249 it has a function for. Identical in all four LibreOffice builds tested.