Statistical function

HYPGEOM.DIST function

Returns the hypergeometric probability: the chance of getting k successes when drawing a sample without replacement from a finite group.

Available in Excel 2010 and later, Microsoft 365, Excel for the web, Excel for Mac 2011 and later

Excel 2010 and laterWorks in Google Sheets

Syntax

HYPGEOM.DIST(sample_s, number_sample, population_s, number_pop, cumulative)
ArgumentWhat it means
sample_sRequiredThe number of successes in the sample (e.g. defective items found).
number_sampleRequiredThe sample size.
population_sRequiredThe number of successes in the whole population.
number_popRequiredThe size of the whole population.
cumulativeRequiredTRUE: probability of at most sample_s successes. FALSE: probability of exactly sample_s.

Returns: A probability between 0 and 1.

How HYPGEOM.DIST works

Picture a delivery of 50 items, 5 of which are faulty. You inspect 8 items. How likely is it that you find exactly one faulty item, or none at all? Because you do not put items back once you have checked them, each draw changes the odds for the next one. The hypergeometric distribution is built for exactly this situation: sampling without replacement from a small, known population. Typical uses are quality-control inspections, audit sampling of invoices, and card or lottery odds.

If the population is large compared with the sample, the result is almost the same as the binomial distribution (BINOM.DIST), which assumes replacement. When the sample is a sizeable share of the population, only the hypergeometric gives the right answer. Arguments with decimals are truncated to whole numbers. Set cumulative to TRUE to add up the probabilities of 0, 1, ..., sample_s successes.

Examples

1Exactly one faulty item in the sample

D2fx=HYPGEOM.DIST(B2, B3, B4, B5, FALSE)
ABCD
1ItemValue
2Faulty found10.4226
3Sample size8
4Faulty in lot5
5Lot size50

Result: 0.4226

The probability is 0.422625, about 42.3% (shown to 4 decimals).

2At most one faulty item

D2fx=HYPGEOM.DIST(B2, B3, B4, B5, TRUE)
ABCD
1ItemValue
2Faulty found10.8241
3Sample size8
4Faulty in lot5
5Lot size50

Result: 0.8241

Adding P(0) = 0.4015 and P(1) gives 0.824118 (shown to 4 decimals). An acceptance rule "accept the lot if at most one item is faulty" would accept this bad lot about 82% of the time.

3Chance an audit sample misses every problem invoice

D2fx=HYPGEOM.DIST(B2, B3, B4, B5, FALSE)
ABCD
1ItemValue
2Problem invoices found00.4015
3Invoices checked8
4Problem invoices5
5Total invoices50

Result: 0.4015

0.401493 (shown to 4 decimals): roughly a 40% chance that a sample of 8 contains none of the 5 problem invoices, a reminder that small audit samples can miss issues.

⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 16 KB

Common errors and how to fix them

ErrorWhy it happensFix
#NUM!Counts are impossible, e.g. sample_s larger than number_sample or population_s, a sample larger than the population, or negative values.Check that every count fits inside the larger one.
#VALUE!An argument is text.Use numbers.

Tips

  • Probability of at least k: =1-HYPGEOM.DIST(k-1, n, K, N, TRUE).
  • The old HYPGEOMDIST function has no cumulative argument and always returns the exact probability.

Google Sheets

HYPGEOM.DIST also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.

HYPGEOM.DIST in other languages

In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.

LanguageFunction name
DanishHYPGEO.FORDELING
DutchHYPGEOM.VERD
FinnishHYPERGEOM_JAKAUMA
FrenchLOI.HYPERGEOMETRIQUE.N
GermanHYPGEOM.VERT
HungarianHIPGEOM.ELOSZLÁS
ItalianDISTRIB.IPERGEOM.N
Norwegian (Bokmål)HYPGEOM.FORDELING.N
PolishROZKŁ.HIPERGEOM
Portuguese (Brazil)DIST.HIPERGEOM.N
Portuguese (Portugal)DIST.HIPGEOM
RussianГИПЕРГЕОМ.РАСП
SpanishDISTR.HIPERGEOM.N
SwedishHYPGEOM.FÖRD
TurkishHİPERGEOM.DAĞ