Google Sheets HYPGEOM.DIST Function Guide
In this article
The HYPGEOM.DIST function in Google Sheets calculates the probability of a specific number of successes in a sequence of draws from a finite population without replacement. Unlike the BINOM.DIST function, which assumes the probability of success remains constant (sampling with replacement), HYPGEOM.DIST accounts for the fact that each draw changes the composition of the remaining pool. This makes it the essential tool for quality control testing, card game probabilities, and ecological sampling where once an item is picked, it cannot be picked again.
What You'll Need
- A Google account with access to Google Sheets.
- A dataset or a specific scenario involving a finite population (e.g., a deck of cards, a batch of manufactured parts, or a group of employees).
- Four specific numerical values: the number of successes in the sample, the number of successes in the population, the total population size, and the sample size.
Step-by-Step
- Identify Your Variables: Before typing the formula, define your four required variables to avoid confusion.
- Sample Successes (x): The number of successful outcomes you are looking for in your sample.
- Population Successes (m): The total number of successful outcomes available in the entire population.
- Population Size (n): The total number of items in the entire population.
- Sample Size (s): The number of items you are drawing from the population.
- Select Your Target Cell: Click on the cell where you want the probability result to appear.
- Enter the Function Name: Type
=HYPGEOM.DIST(into the cell. This opens the function and prepares Google Sheets to receive the arguments. - Input the Sample Successes: Type the number of successes you want to find the probability for, or click a cell containing that value. Follow this with a comma.
- Input the Population Successes: Type the total number of successes available in the population, or click the corresponding cell. Follow this with a comma.
- Input the Population Size: Type the total size of the population, or click the corresponding cell. Follow this with a comma.
- Input the Sample Size: Type the number of items drawn for the sample, or click the corresponding cell. Follow this with a comma.
- Choose the Cumulative Argument: This is a TRUE/FALSE value that determines the type of probability calculated:
- Enter
FALSEfor the Probability Mass Function. This calculates the probability of getting exactly the number of successes specified. - Enter
TRUEfor the Cumulative Distribution Function. This calculates the probability of getting up to and including the number of successes specified.
- Enter
- Close and Execute: Type the closing parenthesis
)and press Enter.
Worked Example: Imagine you have a deck of 52 cards (Population Size = 52). There are 4 Aces in the deck (Population Successes = 4). You draw 5 cards (Sample Size = 5). You want to know the probability of drawing exactly 2 Aces (Sample Successes = 2). Your formula would be: =HYPGEOM.DIST(2, 4, 52, 5, FALSE).
Common Mistakes
One of the most frequent errors is swapping the Population Successes and the Sample Size. Remember that the population success count (m) is the total number of "winners" available in the entire group, whereas the sample size (s) is how many items you actually pick. If you reverse these, Google Sheets may return a #NUM! error because the logic becomes mathematically impossible.
Another common mistake is using the wrong Cumulative argument. Users often use TRUE when they want the probability of a single specific outcome. If you are asking "What is the chance I get exactly 3 red marbles?", you must use FALSE. If you use TRUE, you are actually asking "What is the chance I get 0, 1, 2, or 3 red marbles?", which will result in a much higher probability than expected.
Users also occasionally confuse HYPGEOM.DIST with BINOM.DIST. The key difference is "replacement." If you are flipping a coin or rolling a die, use BINOM.DIST because the odds don't change. If you are drawing names from a hat or picking parts from a bin, use HYPGEOM.DIST because once a name or part is removed, the odds for the next draw change.
Tips
To make your spreadsheets more dynamic, avoid hard-coding numbers directly into the formula. Instead, create a small table with labels like "Population Size" and "Sample Size" in column A and their values in column B. Reference these cells in your formula (e.g., =HYPGEOM.DIST(B1, B2, B3, B4, FALSE)). This allows you to change the scenario instantly without rewriting the formula.
If you need to find the probability of getting at least a certain number of successes, you can subtract the cumulative probability from 1. For example, to find the probability of getting 2 or more successes in a sample, use =1 - HYPGEOM.DIST(1, m, n, s, TRUE). This removes the probability of getting 0 or 1 success from the total probability of 100%.
When dealing with very large populations, you may notice that the results of HYPGEOM.DIST and BINOM.DIST become nearly identical. This is because when the population is massive, removing one item has a negligible effect on the overall probability. In these cases, BINOM.DIST is often simpler to calculate, but HYPGEOM.DIST remains the more accurate choice for absolute precision.
Troubleshooting
If your formula returns a #NUM! error, check the following logic constraints. The function will fail if any of these conditions are met: the sample success count is greater than the population success count, the sample success count is greater than the sample size, or the sample size is greater than the total population size. Essentially, you cannot draw more successes than exist, and you cannot draw more items than are available in the population.
If the result is 0 when you expect a number, check your Cumulative argument. If you are looking for a very rare event (like drawing 4 Aces in a 5-card hand), the probability might be so small that Google Sheets rounds it to zero in the cell display. To fix this, go to the toolbar and increase the decimal places using the .00 button to see the precise scientific notation.
If you see a #VALUE! error, ensure that all four arguments are numbers. If any of the cells you are referencing contain text, spaces, or are formatted as text instead of numbers, the function cannot perform the calculation. Use the =ISNUMBER() function to verify your input cells if you are unsure.
Frequently Asked Questions
What is the difference between HYPGEOM.DIST and BINOM.DIST?
HYPGEOM.DIST is used for sampling without replacement (the population changes after each draw), while BINOM.DIST is used for sampling with replacement (the probability of success stays the same for every draw).
Can I use this function for quality control?
Yes. It is frequently used in Acceptance Sampling. For example, if you have a batch of 1,000 parts and you test 50, you can use this function to determine the probability of finding X defective parts given a known defect rate in the total batch.
What does the "Cumulative" argument actually do?
When FALSE, it calculates the probability of exactly X successes. When TRUE, it calculates the probability of X or fewer successes (the sum of probabilities from 0 up to X).
Why is my result a very long decimal?
Probabilities are expressed as values between 0 and 1. A result of 0.05 means there is a 5% chance of the event occurring. You can format the cell as a percentage by clicking Format > Number > Percent.
Does this function work in Excel?
Yes, the syntax for HYPGEOM.DIST is identical in Microsoft Excel, making it easy to move your probability models between the two platforms.
What happens if the population size is infinite?
The HYPGEOM.DIST function requires a finite population size (n). If the population is effectively infinite, you should use the BINOM.DIST function instead.