ISERROR
Checks whether a value is an error, and returns - true or - false.
Syntax
expression.ISERROR(arg1);
expression - A variable that represents a ApiWorksheetFunction class.
Parameters
| Name | Required/Optional | Data type | Default | Description |
|---|---|---|---|---|
| arg1 | Required | number | string | boolean | ApiRange | ApiName | The value to test. The value can be an empty cell, error, logical value, text, number, range, or range name. |
Returns
boolean
Example
Check if a value is any type of error in a spreadsheet.
// How do I determine if a cell contains an error in a spreadsheet?
// Test whether a value is an error result in a spreadsheet.
const worksheet = Api.GetActiveSheet();
let func = Api.WorksheetFunction;
worksheet.GetRange("B3").SetValue("#N/A")
let result = func.ISERR("B3");
worksheet.GetRange("C3").SetValue(result)