Compatibility

HYPGEOMDIST

Close: 5 of 9 recorded answers differ in the last bits, worst 2 ULP

Everything else matches (3 in the answer bank and 6 workbook cells). Last-bit means a finite number within 16 ULP of Excel's. How we measure this · See the Rust code

Local names in 40 languages
LanguageName in Excel
ArabicHYPGEOMDIST
BulgarianHYPGEOMDIST
CzechHYPGEOMDIST
DanishHYPGEOFORDELING
GermanHYPGEOMDIST
GreekHYPGEOMDIST
English (Australia)HYPGEOMDIST
English (United Kingdom)HYPGEOMDIST
English (United States)HYPGEOMDIST
SpanishDISTR.HIPERGEOM
EstonianHYPGEOMDIST
FinnishHYPERGEOM.JAKAUMA
FrenchLOI.HYPERGEOMETRIQUE
HebrewHYPGEOMDIST
CroatianHYPGEOMDIST
HungarianHIPERGEOM.ELOSZLÁS
IndonesianHYPGEOMDIST
ItalianHYPGEOMDIST
JapaneseHYPGEOMDIST
KoreanHYPGEOMDIST
LithuanianHYPGEOMDIST
LatvianHYPGEOMDIST
NorwegianHYPGEOMDIST
DutchHYPERGEO.VERD
PolishROZKŁAD.HIPERGEOM
Portuguese (Brazil)HYPGEOMDIST
Portuguese (Portugal)DIST.HIPERGEOM
RomanianHYPGEOMDIST
RussianГИПЕРГЕОМЕТ
SlovakHYPGEOMDIST
SlovenianHYPGEOMDIST
Serbian (Latin)HYPGEOMDIST
SwedishHYPGEOMFÖRD
ThaiHYPGEOMDIST
TurkishHİPERGEOMDAĞ işlevi
UkrainianHYPGEOMDIST
VietnameseHYPGEOMDIST
Chinese (Simplified)HYPGEOMDIST
Chinese (Hong Kong)HYPGEOMDIST
Chinese (Traditional)HYPGEOMDIST

Names from Microsoft's support site.

What it does

HYPGEOMDIST(sample_s, number_sample, population_s, number_pop)

HYPGEOMDIST(sample_s, number_sample, population_s, number_pop) models sampling without replacement. It counts successes in a fixed sample drawn from a finite population.This compatibility form returns a mass only.

Try it

Input cells (optional)

Example: {"B2": 3, "B3": 4}. A1 holds the formula. Other cells need values before a formula can read them.

Enter a formula, then calculate.

Runs locally in your browser with OneCalc. Its answer may differ from Excel. Use English function names and commas between arguments.

=HYPGEOMDIST(1,2,3,5) is about 0.6. Drawing two objects from five, three marked successful, yields one success in choose(3,1)*choose(2,1)=6 of choose(5,2)=10 possible samples.

Quirks

The four arguments are counts and are truncated toward zero, with the current code rejecting original negative signs before truncation. The feasible success interval is max(0,n-(N-K))..min(n,K), where n is sample size, K population successes and N population size.

Microsoft’s documented guard gives #NUM! for invalid sizes and success counts; nonnumeric arguments give #VALUE!. The current shared mass helper instead supplies zero for an unsupported success count and handles an empty sample as a degenerate mass. The modern HYPGEOM.DIST has retained build 20430 controls for such departures, but those calls do not measure this legacy spelling. Keep that remaining scope explicit.

How to implement

The mathematical probability is choose(K,k)*choose(N-K,n-k)/choose(N,n). For one success in a sample of two from five objects with three successes, the numerator is 3*2=6 and the denominator ten, giving 0.6.

The current wrapper calls the same mass helper as HYPGEOM.DIST with cumulative FALSE. It rejects original negative signs, truncates the counts, checks n<=N and K<=N, then applies the mass support and degenerate-sample rules. For nondegenerate supported counts it forms p=n/N and q=(N-n)/N, obtains three binomial masses, and returns their product/ratio in the stated order. There is no cumulative switch or cumulative endpoint shortcut on this spelling.

Ratios of integer combinations or a recurrence give alternative mathematical algorithms. They avoid separately overflowing factorials, but do not identify Excel’s numerical leaves or error order. The generated fingerprint report still has no adopted complete hypergeometric algorithm; legacy-spelling boundaries and remaining numerical differences stay open.

Rust code

Show the CalcFunc source of this function

Quoted from the public repository DnaCalc/DnaCalc, crates calc-func and calc-fml, at commit 9e1884369a67. Comments are the source's own. A kernel shared with other functions appears once, on its module page.

HYPGEOMDIST · 4 lines · calc-func/src/catalogue/distributions.rs on GitHub
78 hypgeomdist "HYPGEOMDIST" (4, 4) [V "sample_s", V "number_sample", V "population_s", V "number_pop"] |s, a, sv| {
    let [ss, ns, ps, np] = nums::<4>(s, a)?;
    out(s, dd::hypergeom_dist_kernel(ss, ns, ps, np, false))
}

Kernels shared with other functions

Argument and result plumbing

  • num catalogue/kit
  • out catalogue/kit

No implementation has been published with a Handbook test suite for this function.

Version differences

The recorded environments below distinguish a reading from a same-input comparison. Counts describe captured inputs in each environment; overlapping captures and comparisons are not totals of unique worksheet calls.

Excel 16.0 buildPlatform and CPUCaptured inputs
19929Windows, bitness not recorded, CPU not recorded46
20131Windows, bitness not recorded, AMD Ryzen 7 4800H with Radeon Graphics3

The record contains no same-input comparison between these environments. Reading different inputs on different builds does not establish either a version change or cross-build agreement.

Recorded environments and comparison details.

Excel 16.0 build 19929

Windows, bitness not recorded, CPU not recorded

46 captured inputs are indexed for this environment. Capture dates are not recorded. This is a reading count, not a comparison with another build.

Excel 16.0 build 20131

Windows, bitness not recorded, AMD Ryzen 7 4800H with Radeon Graphics

3 captured inputs are indexed for this environment. Capture dates: 2026-07-16 to 2026-07-16. This is a reading count, not a comparison with another build.

Alternatives

BINOM.DIST models independent trials with replacement; COMBIN counts combinations; HYPGEOM.DIST exposes the cumulative switch.

Named variants

No named variants are recorded yet.

Suggest a correction or contribute an implementation · For agents