GAMMAINV
Returns the inverse of the gamma cumulative distribution: if p = GAMMADIST(x,...), then GAMMAINV(p,...) = x.
Syntax
expression.GAMMAINV(arg1, arg2, arg3);
expression - A variable that represents a ApiWorksheetFunction class.
Parameters
| Name | Required/Optional | Data type | Default | Description |
|---|---|---|---|---|
| arg1 | Required | ApiRange | ApiName | number | The probability associated with the gamma distribution, a number between 0 and 1, inclusive. | |
| arg2 | Required | ApiRange | ApiName | number | The alpha parameter of the distribution, a positive number. | |
| arg3 | Required | ApiRange | ApiName | number | The beta parameter of the distribution, a positive number. If this parameter is equal to 1, the function returns the standard gamma distribution. |
Returns
number
Example
Find the value that corresponds to a given probability in a gamma distribution in a spreadsheet.
// How do I calculate the inverse of a gamma cumulative distribution in a spreadsheet?
// Get the x-value for a probability point in a gamma distribution in a spreadsheet.
let worksheet = Api.GetActiveSheet();
let func = Api.WorksheetFunction;
let ans = func.GAMMAINV(0.4, 9, 2);
worksheet.GetRange("B2").SetValue(ans);