Skip to main content

GAMMALN

Returns the natural logarithm of the gamma function.

Syntax

expression.GAMMALN(arg1);

expression - A variable that represents a ApiWorksheetFunction class.

Parameters

NameRequired/OptionalData typeDefaultDescription
arg1RequiredApiRange | ApiName | numberThe value for which the natural logarithm of the gamma function will be calculated, a positive number.

Returns

number

Example

Return the natural logarithm of the gamma function in a spreadsheet.

// How to calculate the natural logarithm of the gamma function in a spreadsheet.

// Use a function to calculate the natural logarithm of the gamma function value in a spreadsheet.

let worksheet = Api.GetActiveSheet();
let func = Api.WorksheetFunction;
let ans = func.GAMMALN(0.5);
worksheet.GetRange("B2").SetValue(ans);