ISERROR Function¶
The ISERROR function in Excel is used to check whether a value is any error. It returns TRUE if the value is any error type — including #N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME?, and #NULL! — and FALSE for all non-error values. This function is useful for trapping all errors in formulas and providing fallback values or alternative logic when errors occur.
Key Features of ISERROR:¶
- Returns
TRUEfor any error value, including#N/A,#VALUE!,#REF!,#DIV/0!,#NUM!,#NAME?, and#NULL!. - Returns
FALSEfor non-error values (numbers, text, logicals, blanks). - Commonly used with
IFto substitute default values or trigger actions when any formula error occurs. - Catches all error types, unlike
ISERRwhich excludes#N/A. - For simpler error handling, consider
IFERROR, which combines the error check and fallback into a single function.
Syntax:¶
- value: The value or expression you want to test for an error. Typically a cell reference or formula result.
How ISERROR Works:¶
ISERRORevaluates the provided value or expression.- If the result is any error value —
#N/A,#VALUE!,#REF!,#DIV/0!,#NUM!,#NAME?, or#NULL!— it returnsTRUE. - If the result is any non-error value (number, text, logical, blank), it returns
FALSE.
Examples:¶
1. Division by Zero Error:¶
If A1 contains a formula that results in #DIV/0!:
Result:
2. #N/A Error:¶
If A1 contains #N/A:
Result:
3. Valid Number:¶
If A1 contains 100:
Result:
4. #VALUE! Error:¶
If A1 contains a formula that results in #VALUE!:
Result:
5. Text Value:¶
If A1 contains "Hello":
Result:
6. Conditional Error Handling:¶
Result:
7. Protecting a VLOOKUP:¶
Result:
8. Counting Error Cells in a Range:¶
Result:
Notes:¶
ISERRORcatches all error types, including#N/A. If you want to exclude#N/Afrom detection, useISERRinstead.- If you only want to detect
#N/Aerrors, useISNA. - For simpler error handling, consider
IFERROR(handles all errors in a single function) orIFNA(handles only#N/A). ISERRORis part of the IS family of information functions (ISBLANK,ISERR,ISERROR,ISNA,ISNUMBER,ISTEXT,ISLOGICAL, etc.).- When used with
IF,ISERRORevaluates the expression twice (once for the test and once for the result).IFERRORis more efficient as it evaluates only once. ISERRORreturnsFALSEfor blank cells, since a blank cell is not an error.
Applications:¶
- Universal Error Handling: Trap any error type in formulas and provide fallback values or messages.
- Data Validation: Identify cells with errors in a dataset for auditing and troubleshooting.
- Conditional Formatting: Drive formula-based conditional formatting to highlight cells containing any error.
- Robust Formulas: Prevent errors from cascading through dependent formulas by catching them early.
- Error Reporting: Count or flag all error cells in a range for quality assurance.
Related Functions:¶
- ISERR: Returns TRUE if the value is any error except
#N/A. - ISNA: Returns TRUE only if the value is the
#N/Aerror. - IFERROR: Returns a specified value if a formula evaluates to any error; otherwise returns the formula result.
- IFNA: Returns a specified value if a formula evaluates to
#N/A; otherwise returns the formula result. - ISBLANK: Returns TRUE if the cell is empty.
- ISNUMBER: Returns TRUE if the value is a number.
- ISTEXT: Returns TRUE if the value is text.
- TYPE: Returns a numeric code indicating the data type of a value.
Tip: In modern Excel,
IFERRORis generally preferred overIF(ISERROR(...), ...)because it is more concise and more efficient — it evaluates the expression only once. However,ISERRORremains useful when you need to use the error check result in more complex logical expressions, or when combining with other IS functions to distinguish between different error types.