ISERROR

Description

The ISERROR function tests whether a value or formula expression results in an error.

Usage

ISERROR(value)

Arguments

Argument Type Required Description
value Any Yes The value or expression you wish to test for an error.

Result

  • TRUE if the value or expression results in an error.
  • FALSE if the value or expression does not result in an error.

Remarks

Errors in ActivityInfo formulas can occur in a number of situations, such as performing arithmetic on non-numeric values, or applying a function to an incompatible field type. The ISERROR function allows you to detect and handle these situations rather than allowing the error to propagate through your calculated fields or pivot tables.

ISERROR is commonly used together with the IF function to return a fallback value when an error is detected.

Examples

Converting a text field to a number

When working with data collected in a text field, you may sometimes need to convert the text value to a number value for use in calculations. However, if the text field contains a non-numeric value such as "N/A", a label, or an accidentally entered word, the conversion will fail and return an error.

The VALUE function converts a text value to a number, but it will produce an error if the text cannot be converted. You can use ISERROR to catch this and return a blank instead:

IF(ISERROR(VALUE(RESPONSE)), "", VALUE(RESPONSE))

This formula attempts to convert the field RESPONSE to a number. If the conversion fails, it returns a blank value rather than an error. If the conversion succeeds, it returns the numeric value.

For example, the text field RESPONSE where data entry users have recorded quantities, but some entries contain non-numeric text:

Response Converted Value
45 45
N/A
unknown

This is particularly useful when preparing data for pivot tables or calculated fields that require a numeric input, as it ensures that non-numeric entries do not cause the entire calculation to fail.

Flagging incomplete records

You can use ISERROR to flag records where a calculation cannot be completed, which is helpful for identifying data quality issues. For example, if you have a text field AGE that is expected to contain a number, you can flag records where the value cannot be used in a calculation:

IF(ISERROR(VALUE(AGE)), "Check required", "OK")

This would produce the following results:

Age Status
25 OK
N/A Check required
unknown Check required
Next item
ISNUMBER