# HYPGEOMDIST function

Returns the hypergeometric distribution. HYPGEOMDIST returns the probability of a given number of sample successes, given the sample size, population successes, and population size. Use HYPGEOMDIST for problems with a finite population, where each observation is either a success or a failure, and where each subset of a given size is chosen with equal likelihood.

Important   This function has been replaced with one or more new functions that may provide improved accuracy and whose names better reflect their usage. Although this function is still available for backward compatibility, you should consider using the new functions from now on, because this function may not be available in future versions of Excel.

## Syntax

`HYPGEOMDIST(sample_s,number_sample,population_s,number_pop)`

The HYPGEOMDIST function syntax has the following arguments (argument: A value that provides information to an action, an event, a method, a property, a function, or a procedure.):

• Sample_s     Required. The number of successes in the sample.
• Number_sample     Required. The size of the sample.
• Population_s     Required. The number of successes in the population.
• Number_pop     Required. The population size.

## Remarks

• All arguments are truncated to integers.
• If any argument is nonnumeric, HYPGEOMDIST returns the #VALUE! error value.
• If sample_s < 0 or sample_s is greater than the lesser of number_sample or population_s, HYPGEOMDIST returns the #NUM! error value.
• If sample_s is less than the larger of 0 or (number_sample - number_population + population_s), HYPGEOMDIST returns the #NUM! error value.
• If number_sample ≤ 0 or number_sample > number_population, HYPGEOMDIST returns the #NUM! error value.
• If population_s ≤ 0 or population_s > number_population, HYPGEOMDIST returns the #NUM! error value.
• If number_population ≤ 0, HYPGEOMDIST returns the #NUM! error value.
• The equation for the hypergeometric distribution is:

where:

x = sample_s

n = number_sample

M = population_s

N = number_population

HYPGEOMDIST is used in sampling without replacement from a finite population.

## Example

A sampler of chocolates contains 20 pieces. Eight pieces are caramels, and the remaining 12 are nuts. If a person selects 4 pieces at random, the following function returns the probability that exactly 1 piece is a caramel.

The example may be easier to understand if you copy it to a blank worksheet.

1. Select the example in this article. If you are copying the example in Excel Web App, copy and paste one cell at a time.Important Do not select the row or column headers.

Selecting an example from Help

1. Press CTRL+C.
2. Create a blank workbook or worksheet.
3. In the worksheet, select cell A1, and press CTRL+V. If you are working in Excel Web App, repeat copying and pasting for each cell in the example.

Important For the example to work properly, you must paste it into cell A1 of the worksheet.

1. To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

After you copy the example to a blank worksheet, you can adapt it to suit your needs.

A B
Data Description
1 Number of successes in the sample
4 Sample size
8 Number of successes in the population
20 Population size
Formula Description (Result)
=HYPGEOMDIST(A2,A3,A4,A5) Hypergeometric distribution for sample and population above (0.363261)

Applies to:
Excel 2010, Excel Web App, SharePoint Online for enterprises, SharePoint Online for professionals and small businesses