Contact

HYPGEOMDIST Function (OpenOffice Calc)

Statistical Intermediate OpenOffice Calc

OpenOffice HYPGEOMDIST takes four arguments for exact-count probabilities. Learn valid support bounds and how to sum masses for a cumulative result.

Verification status: Official release source and independently calculated examples for HYPGEOMDIST 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: =HYPGEOMDIST(2;5;7;20) gives approximately 0.387383900929. It is the chance of exactly two successes when drawing five items without replacement from twenty items containing seven successes.

Availability and version history

  • Introduced: First release not established. The OpenOffice.org 3.3 function appendix documents this name; historical presence does not prove introduction.
  • Supported in: Apache OpenOffice 4.1.16. No final supported release has been established.
  • Scope: Desktop Calc. Current argument defaults are stated for the cited release, not inferred for every older version.
  • Checked: October 14, 2026. Official documentation/source and independent mathematics checked; Apache OpenOffice Calc was not run for this guide.

Sampling without replacement

The hypergeometric model describes a finite population. Each selected item is removed before the next draw, so the success probability changes as sampling proceeds. That differs from a binomial model with independent trials and a constant success probability. Official reference.

For x successes in n draws, M successful items in a population of N, the probability mass is COMBIN(M;x)×COMBIN(N−M;n−x)/COMBIN(N;n). This is a discrete probability mass, not a continuous density. Exact integer counts determine the combinations.

Syntax and arguments

=HYPGEOMDIST(X; NSample; Successes; NPopulation)

The first four inputs are counts. Use nonnegative integers, with 0≤Successes≤NPopulation and 0≤NSample≤NPopulation. The feasible success count lies between MAX(0;NSample−(NPopulation−Successes)) and MIN(NSample;Successes).

Apache OpenOffice 4.1.16 accepts exactly four arguments and calculates exactly X successes. Do not add LibreOffice’s optional cumulative argument to this spelling in OpenOffice; use an explicit sum of valid probability masses when a cumulative total is needed. The versioned evaluator establishes this contract.

Reproducible reference cases

The first six rows enumerate the possible success counts for n=5, M=7, N=20. Each input is an integer. Expected values are independently calculated and rounded to twelve decimal places.

Formula Expected result, approximately
=HYPGEOMDIST(0;5;7;20) 0.083010835913
=HYPGEOMDIST(1;5;7;20) 0.322819917441
=HYPGEOMDIST(2;5;7;20) 0.387383900929
=HYPGEOMDIST(3;5;7;20) 0.176083591331
=HYPGEOMDIST(4;5;7;20) 0.029347265222
=HYPGEOMDIST(5;5;7;20) 0.001354489164
=HYPGEOMDIST(0;5;0;20) 1
=HYPGEOMDIST(5;5;20;20) 1

Practical worksheet: inspect a fixed lot

Suppose a lot contains twenty items, seven of a specified type, and five items are sampled uniformly without replacement. Put 2, 5, 7 and 20 in A2:D2. In E2 use =HYPGEOMDIST(A2;B2;C2;D2), expected 0.387383900929.

This model assumes the population composition is known and every size-five subset is equally likely. Sampling with replacement, biased selection or an uncertain success count changes the model. The formula cannot determine those assumptions from four numbers.

Advanced example: at most two successes

Use =HYPGEOMDIST(0;5;7;20)+HYPGEOMDIST(1;5;7;20)+HYPGEOMDIST(2;5;7;20). All three counts are feasible for this population, so each term is valid. The expected cumulative probability is approximately 0.793214654283. The probability of at least three successes is its complement, approximately 0.206785345717.

For a general table, put integer counts 0 through 5 in A5:A10 and enter =HYPGEOMDIST(A5;5;7;20) in B5, filling down. =SUM(B5:B10) should be approximately 1. This is a full-support check, not a rule that every arbitrary interval of counts sums to 1.

Feasible support and release differences

The release floors count inputs before its checks, but fractional counts are not meaningful sample sizes. Validate them as integers rather than relying on truncation to repair the data.

This release rejects X outside the feasible success support as an invalid argument, rather than returning a generic mathematical zero. For example X=2, sample=5, successes=1, population=20 is rejected. When summing masses, start and stop within the feasible range.

The implementation also imposes an internal size limit to prevent excessively large coefficient arrays. That limit is not an invitation to approach it without testing; large populations need separate numerical and runtime checks.

Errors and interpretation

Keep population successes distinct from observed sample successes. Swapping them may still produce an answer while describing another experiment. Compare the six-row probability table and check the full sum before adapting the model.

These reference values do not establish native behavior for every large count, Boolean, text value or imported workbook. A zero mass, an invalid parameter error and an untested extreme calculation are different outcomes and should not be silently replaced with one another.

Official sources