ISERROR function
The ISERROR function in Excel is used to check whether a value or expression results in any type of error, including #N/A. It returns TRUE if the value is an error and FALSE otherwise.
Syntax:
ISERROR(value)
Arguments:
- value: The cell reference, value, or expression you want to check for an error.
Error Types Caught by ISERROR:
ISERROR can catch all types of errors, including:
#DIV/0!(Division by zero)#VALUE!(Invalid value)#REF!(Invalid cell reference)#NAME?(Invalid function or name)#NUM!(Invalid numeric value)#NULL!(Null intersection)#N/A(Value not available)
Examples:
Example 1: Division by zero
- Formula:
=ISERROR(1/0) - Result:
TRUE(since1/0results in a#DIV/0!error).
Example 2: Valid number
- Formula:
=ISERROR(100) - Result:
FALSE(since 100 is not an error).
Example 3: #N/A error
- Formula:
=ISERROR(NA()) - Result:
TRUE(since#N/Ais considered an error in ISERROR).
Use Cases:
- Error Handling: Use ISERROR to catch and handle errors in formulas:
=IF(ISERROR(A1/B1), "Error Detected", A1/B1)This avoids Excel’s default error messages and displays custom text instead of errors.
- Formulas with Multiple Calculations: Trap errors when performing multiple calculations, such as:
=IF(ISERROR(A1/B1), "Invalid Division", A1/B1)
Key Points:
- ISERROR vs. ISERR:
- ISERROR catches all errors, including
#N/A. - ISERR catches all errors except
#N/A.
- ISERROR catches all errors, including
- Error Handling with IFERROR:
- If you want to handle errors more easily in formulas, use IFERROR instead:
=IFERROR(A1/B1, "Error")This provides a simpler way to handle any type of error without checking explicitly.