Skip to main content

GAMMA_DIST

Returns the gamma distribution.

Syntax​

expression.GAMMA_DIST(arg1, arg2, arg3, arg4);

expression - A variable that represents an ApiWorksheetFunction class.

Parameters​

NameRequired/OptionalData typeDefaultDescription
arg1RequiredApiRange | ApiName | numberThe value at which the distribution will be calculated, a nonnegative number.
arg2RequiredApiRange | ApiName | numberThe alpha parameter of the distribution, a positive number.
arg3RequiredApiRange | ApiName | numberThe beta parameter of the distribution, a positive number. If this parameter is equal to 1, the function returns the standard gamma distribution.
arg4RequiredApiRange | ApiName | booleanA 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 density function.

Returns​

number

Example​

Calculate the probability of a value in a gamma distribution in a spreadsheet.

// How do I evaluate a gamma distribution at a specific point in a spreadsheet?

// Get the cumulative or probability density of a gamma distribution in a spreadsheet.

let worksheet = Api.GetActiveSheet();
let func = Api.WorksheetFunction;
let ans = func.GAMMA_DIST(10, 9, 2, false);
worksheet.GetRange("B2").SetValue(ans);