ISERROR (Value) ISERROR (Value)

Value

The value to check.

Returns

Logical Logical

Whether the given value is an error.

Returns whether the given value is an error. ISERROR (Value1 / Value2) ISERROR (Value1 / Value2), for instance, returns TRUE when Value2 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 (Value1 / Value2, 0) IFERROR (Value1 / Value2; 0) returns Value1 if the calculation does not result in an error, and 0 otherwise.

ISERROR and arrays

Applying ISERROR to an array yields a logical array with the same size as the original array, where TRUE elements indicate that the corresponding element in the original array is an error and FALSE elements indicate the opposite.

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:

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

Use OR to determine if one or more array elements are errors. This formula returns TRUE, as the first array element is an error:

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

Examples

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

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

ISERROR (Value1 / Value2)
ISERROR (Value1 / Value2)

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

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

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.

fxEngine Shell Want this in your own terminal? A standalone version is coming. Get notified.
Loading fxEngine Shell