Contact

HYPGEOMDIST in ONLYOFFICE Spreadsheet Editor

Statistical Intermediate ONLYOFFICE Spreadsheet Editor

Use the inspected four-argument hypergeometric mass function, understand its help/arity discrepancy, and calculate small without-replacement probabilities.

Verification status: See the evidence and test scope described in this guide. How formula examples are checked

Quick answer: =HYPGEOMDIST(1,3,4,10) has independent expectation 0.5, the chance of exactly one success in three draws from ten items containing four successes.

Availability and evidence scope

  • Introduced: Original introduction release is not established by the checked sources.
  • Available: Listed in current unversioned ONLYOFFICE help, checked October 18, 2026.
  • Implementation inspected: Official SDKJS v10.0.0.169, commit 3679e0375a758d7dc59d31337a45461be3525ed8. The snapshot does not prove identical behavior in every installed editor.
  • Retired or deprecated: These sources do not establish retirement or formal deprecation. A legacy name alone does not mean the function has been removed.
  • Testing: Numerical examples are independent mathematical expectations, and implementation discrepancies are labeled source predictions. No ONLYOFFICE application or calculation-engine execution was performed.

The examples use English function names and commas. Use your locale’s argument separator if different. Retain full precision in formulas; round only the displayed result. The examples describe function mechanics under the stated model, rather than establishing that your observations follow that model.

Syntax: four arguments in the inspected source

=HYPGEOMDIST(sample_s, number_sample, population_s, number_pop)

Documentation discrepancy: Current ONLYOFFICE help shows a fifth cumulative argument and describes both mass and cumulative modes. The inspected SDKJS v10.0.0.169 implementation registers exactly four arguments and always passes FALSE to its hypergeometric helper. Its calculation is therefore mass-only. No application execution was performed to establish how an installed editor responds to a fifth argument.

Use the four-argument form above for this source-backed description. Use modern HYPGEOM.DIST with an explicit fifth TRUE/FALSE argument when a cumulative formula is intended. The functions are related, but their signatures are not interchangeable in the inspected version. Formal retirement or deprecation is not established by the presence of a newer spelling.

The arguments mean k successes in a sample of n draws, from a population containing M successes among N total items. Draws are without replacement and samples of a given size are assumed equally likely. The result is P(X=k), a probability mass. Unlike a continuous PDF, this value is the probability of one exact integer count.

Step-by-step: make a complete probability table

A container has 10 items: 4 blue and 6 nonblue. Select 3 without replacement and count the blue items.

  1. Enter candidate counts 0, 1, 2, 3 in A2:A5.
  2. In B2 enter =HYPGEOMDIST(A2,3,4,10) and copy down.
  3. Label B “probability of exactly this many blue items.”
  4. Add the four results as a check; their independent mathematical total is 1.
Count Favorable samples out of 120 Independent mass
0 20 0.166666666667
1 60 0.5
2 36 0.3
3 4 0.033333333333

The denominator is COMBIN(10,3)=120. For one blue item the numerator is COMBIN(4,1)*COMBIN(6,2)=4*15=60. More generally the mass is COMBIN(M,k)*COMBIN(N-M,n-k)/COMBIN(N,n) for counts inside the feasible support. These exact integer combinations independently check the small example without executing spreadsheet calculation code.

Advanced example: build an event from several masses

To calculate the chance of at least two blue items, add the k = 2 and k = 3 masses: =HYPGEOMDIST(2,3,4,10)+HYPGEOMDIST(3,3,4,10). The independent result is 36/120+4/120 = 1/3.

“At most one” is the sum of k = 0 and k = 1, which is 2/3. You can also use =HYPGEOM.DIST(1,3,4,10,TRUE) for that cumulative event in the modern function. Do not append TRUE to the legacy formula based only on its current help page; that five-argument signature is not registered in the source inspected here.

For a larger table, keep the population parameters in fixed-reference cells and list only feasible k values. The feasible lower bound is MAX(0,n-(N-M)), and the upper bound is MIN(n,M). For example, if most items are drawn, zero successes may be impossible because there are not enough failures in the population. A full-table sum near 1 is a useful numerical check, though it does not verify that the sampling assumptions match a real process.

Rounding, support and validation

All four counts are floored in the inspected implementation. Thus =HYPGEOMDIST(1.9,3.9,4.9,10.9) is source-predicted to reduce to the integer example and return approximately 0.5. Enter whole counts explicitly; silently discarded fractions can conceal an upstream data error.

Negative floored counts, n>N or M>N produce internal not_numeric, conventionally #NUM!. The wrapper also rejects counts greater than 2,147,483,647. Within otherwise valid inputs, a nonnegative k outside feasible support returns 0 through the helper rather than an error; negative k is rejected first. Current help’s strict positive bounds do not fully describe these source boundary cases.

The implementation computes combination probabilities through logarithmic gamma expressions, so the engine would normally produce floating-point approximations even when the independent answer is an exact fraction. Keep full values for further arithmetic and format the result only for display. The legacy body reduces array inputs to their first element rather than using the modern distribution’s array helper; these scalar examples do not establish equivalent spill behavior.

Sampling with replacement, unequal selection chances or a population whose category counts change during selection does not have the stated hypergeometric model. A numeric answer cannot diagnose a mismatch between that model and the data.

Recalculate representative formulas when moving a workbook between editors. Matching names do not guarantee identical argument coercion, array behavior, numerical precision or error handling. The scalar formulas here do not establish automatic spill behavior or a general import/export guarantee.

Official references