ISERROR function

ISERROR(value) ISERROR(value)

value

The value to check.

Returns — Logical

Whether the given value is an error.

Returns whether the given value is an error. ISERROR(Field1 / Field2)ISERROR(Field1 / Field2), for instance, returns TRUE when the value of Field2 is 0 or blank, resulting in a #DIV/0! error ("division by zero").

Unlike ISERR, the ISERROR function returns TRUE if the given value is of any error type. The ERROR.TYPE function can be used to determine the precise error type.

IFERROR is a convenient way of returning a different value if a value is an error, or the value itself otherwise. IFERROR(Field1 / Field2, 0)IFERROR(Field1 / Field2; 0) returns the value of Field1 (Field1.ValueField1,Value) if the calculation does not result in an error, and 0 otherwise.

Errors are never displayed to your users

When you preview your app, any errors are shown in red. This is meant to help you, the author of the app, determine the cause of potentially unexpected behavior. Errors are also shown when you sign into Calcapp Connect with your credentials and run your own apps.

However, these errors are not shown in shared apps, meaning that errors are never shown to your users. Instead, a field with an error looks like a blank field in shared apps.

If you want to hide errors from showing up in the preview and in Calcapp Connect, use a formula like the following:

IFERROR([your formula], BLANK())IFERROR([your formula]; BLANK())

ISERROR and arrays

Applying ISERROR to an array only yields a single value, related to the array value itself and not its constituent elements.

This formula returns FALSE, as the array as a whole is not an error, even if its first element is an #N/A error:

ISERROR({ NA(), 4 })ISERROR({ NA(); 4 })

Use MAP to invoke ISERROR once for every array element and have the results returned as a logical array.

This formula returns { TRUE, FALSE }{ TRUE; FALSE }, indicating that the first array element is an #N/A error and the second array element is not an error:

MAP({ NA(), 4 }, ISERROR(Element))MAP({ NA(); 4 }; ISERROR(Element))

Examples

ISERROR(NA())ISERROR(NA())

Returns TRUE, as the NA function returns an #N/A error.

ISERROR(Field1 / Field2)ISERROR(Field1 / Field2)

Returns TRUE when the value of Field2 is 0 or blank, resulting in a #DIV/0! error ("division by zero").

ISERROR({ NA(), 4 })ISERROR({ NA(); 4 })

Returns FALSE, as the array as a whole is not an error.

MAP({ NA(), 4 }, ISERROR(Element))MAP({ NA(); 4 }; ISERROR(Element))

Returns { TRUE, FALSE }{ TRUE; FALSE }, indicating that the first array element is an #N/A error and the second array element is not an error.