HYPGEOM_DIST
Returns the hypergeometric distribution.
Syntax
expression.HYPGEOM_DIST(arg1, arg2, arg3, arg4, arg5);
expression - A variable that represents a ApiWorksheetFunction class.
Parameters
| Name | Required/Optional | Data type | Default | Description |
|---|---|---|---|---|
| arg1 | Required | ApiRange | ApiName | number | The number of successes in the sample. | |
| arg2 | Required | ApiRange | ApiName | number | The size of the sample. | |
| arg3 | Required | ApiRange | ApiName | number | The number of successes in the population. | |
| arg4 | Required | ApiRange | ApiName | number | The population size. | |
| arg5 | Required | ApiRange | ApiName | boolean | A logical value (true or false) that determines the function form. If it is true, the function returns the cumulative distribution function. If it is false, the function returns the probability mass function. |
Returns
number
Example
Calculate the hypergeometric distribution with cumulative or probability density in a spreadsheet.
// How do I compute hypergeometric probabilities with different distribution types in a spreadsheet?
// Return cumulative or probability density values from a hypergeometric distribution in a spreadsheet.
let worksheet = Api.GetActiveSheet();
let func = Api.WorksheetFunction;
worksheet.GetRange("A1").SetValue(func.HYPGEOM_DIST(2, 3, 3, 12, true));