Skip to main content

LN

Returns the natural logarithm of a number.

Syntax​

expression.LN(arg1);

expression - A variable that represents an ApiWorksheetFunction class.

Parameters​

NameRequired/OptionalData typeDefaultDescription
arg1RequiredApiRange | ApiName | numberThe positive real number for which the natural logarithm will be returned.

Returns​

number

Example​

Calculate the natural logarithm of a number in a spreadsheet.

// How do I find the natural logarithm (base e) of a value in a spreadsheet?

// Get the inverse exponential of a number in a spreadsheet.

let worksheet = Api.GetActiveSheet();
let func = Api.WorksheetFunction;
worksheet.GetRange("A1").SetValue(func.LN(23));