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)| Argument | What it means | |
|---|---|---|
sample_s | Required | The number of successes in the sample (e.g. defective items found). |
number_sample | Required | The sample size. |
population_s | Required | The number of successes in the whole population. |
number_pop | Required | The size of the whole population. |
cumulative | Required | TRUE: 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
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Item | Value | ||
| 2 | Faulty found | 1 | 0.4226 | |
| 3 | Sample size | 8 | ||
| 4 | Faulty in lot | 5 | ||
| 5 | Lot size | 50 |
Result: 0.4226
The probability is 0.422625, about 42.3% (shown to 4 decimals).
2At most one faulty item
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Item | Value | ||
| 2 | Faulty found | 1 | 0.8241 | |
| 3 | Sample size | 8 | ||
| 4 | Faulty in lot | 5 | ||
| 5 | Lot size | 50 |
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
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Item | Value | ||
| 2 | Problem invoices found | 0 | 0.4015 | |
| 3 | Invoices checked | 8 | ||
| 4 | Problem invoices | 5 | ||
| 5 | Total invoices | 50 |
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.
Common errors and how to fix them
| Error | Why it happens | Fix |
|---|---|---|
#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
cumulativeargument 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.
| Language | Function name |
|---|---|
| Danish | HYPGEO.FORDELING |
| Dutch | HYPGEOM.VERD |
| Finnish | HYPERGEOM_JAKAUMA |
| French | LOI.HYPERGEOMETRIQUE.N |
| German | HYPGEOM.VERT |
| Hungarian | HIPGEOM.ELOSZLÁS |
| Italian | DISTRIB.IPERGEOM.N |
| Norwegian (Bokmål) | HYPGEOM.FORDELING.N |
| Polish | ROZKŁ.HIPERGEOM |
| Portuguese (Brazil) | DIST.HIPERGEOM.N |
| Portuguese (Portugal) | DIST.HIPGEOM |
| Russian | ГИПЕРГЕОМ.РАСП |
| Spanish | DISTR.HIPERGEOM.N |
| Swedish | HYPGEOM.FÖRD |
| Turkish | HİPERGEOM.DAĞ |