Skip to main content

ERROR_TYPE

Returns a number matching an error value.

Syntax

expression.ERROR_TYPE(arg1);

expression - A variable that represents a ApiWorksheetFunction class.

Parameters

NameRequired/OptionalData typeDefaultDescription
arg1RequiredErrorValue | ApiRange | ApiNameThe error value for which the identifying number will be returned. It can be an actual error value or a reference to a cell containing an error value.

Returns

number

Example

const worksheet = Api.GetActiveSheet();
let func = Api.GetWorksheetFunction();
let nonPositiveNum = 0;
let logResult = func.LOG(nonPositiveNum);
worksheet.GetRange("B3").SetValue(logResult);
worksheet.GetRange("C3").SetValue(func.ERROR_TYPE(logResult));