The ISERROR function returns TRUE if a value is any error type, and FALSE otherwise. It detects all Excel error types including #N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME?, and #NULL!. This function is essential for error detection before processing data and preventing error propagation through calculations.
Master the fundamentals of Excel ISERROR function
The ISERROR function is Excel's comprehensive error detection tool. Unlike IFERROR which handles errors automatically, ISERROR simply reports whether an error exists, giving you more control over error handling logic. It's particularly useful when you need different handling for different error types or when you want to log errors before resolving them.
ISERROR catches all seven Excel error types: #N/A (value not available - common in lookup functions), #VALUE! (wrong data type or invalid argument), #REF! (invalid cell reference), #DIV/0! (division by zero), #NUM! (invalid numeric value), #NAME? (unrecognized function or name), and #NULL! (invalid intersection). This comprehensive detection makes ISERROR ideal for general error checking.
ISERROR detects errors but doesn't resolve them. Use ISERROR with IF to create conditional error handling: =IF(ISERROR(formula), alternative_value, formula). However, note that this pattern evaluates the formula twice, which can be inefficient. IFERROR evaluates once and handles both success and error cases more efficiently.
ISERROR evaluates its argument completely before checking for errors. If you use =IF(ISERROR(complex_formula), default, complex_formula), the complex formula executes twice - once in ISERROR and once in IF. For better performance, use IFERROR instead, or store the formula result in a helper cell and reference it.
ISERROR is broader than ISNA (which only checks #N/A) and ISERR (which checks all errors except #N/A). Use ISNA when working with lookup functions where #N/A is expected and you want to ignore other errors. Use ISERR when you want to catch errors but treat #N/A differently.
Errors in Excel formulas propagate to all dependent cells. Using ISERROR to detect and handle errors prevents this cascade, allowing your spreadsheet to continue functioning even when individual calculations fail. This is crucial for robust financial models and data analysis tools.
Function-specific parameters
Function-specific return type
ISERROR catches all seven Excel error types: #N/A (value not available - common in lookup functions), #VALUE! (wrong data type or invalid argument), #REF! (invalid cell reference), #DIV/0! (division by zero), #NUM! (invalid numeric value), #NAME? (unrecognized function or name), and #NULL! (invalid intersection). This comprehensive detection makes ISERROR ideal for general error checking.
ISERROR detects errors but doesn't resolve them. Use ISERROR with IF to create conditional error handling: =IF(ISERROR(formula), alternative_value, formula). However, note that this pattern evaluates the formula twice, which can be inefficient. IFERROR evaluates once and handles both success and error cases more efficiently.
ISERROR evaluates its argument completely before checking for errors. If you use =IF(ISERROR(complex_formula), default, complex_formula), the complex formula executes twice - once in ISERROR and once in IF. For better performance, use IFERROR instead, or store the formula result in a helper cell and reference it.
ISERROR is broader than ISNA (which only checks #N/A) and ISERR (which checks all errors except #N/A). Use ISNA when working with lookup functions where #N/A is expected and you want to ignore other errors. Use ISERR when you want to catch errors but treat #N/A differently.
Exact matching required
Returns numeric position
Handles missing text gracefully
=ISERROR(value)The value, cell reference, or formula result to check for errors. This can be any expression that might produce an error value.
TRUE if the value is any error type (#N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME?, #NULL!), FALSE if the value is not an error
Description: ISERROR(value)
Basic ISERROR with division
Checks if dividing A1 by B1 produces an error. Returns TRUE if B1 is 0 (causing #DIV/0!), empty, or if either cell contains an error.
VBA implementation for ISERROR.
Sub ISERRORExample()
' Note: VBA doesn't have a direct ISERROR function like Excel
' Use error handling with On Error statement
Dim result As Variant
Dim hasError As Boolean
' Method 1: Using On Error Resume Next
On Error Resume Next
result = Range("A1").Value / Range("B1").Value
hasError = (Err.Number <> 0)
On Error GoTo 0
If hasError Then
MsgBox "Division resulted in an error"
Else
MsgBox "Result: " & result
End If
' Method 2: Using WorksheetFunction.IsError
Dim cellValue As Variant
cellValue = Range("A1").Value
If Application.WorksheetFunction.IsError(cellValue) Then
MsgBox "Cell A1 contains an error"
Else
MsgBox "Cell A1 value: " & cellValue
End If
' Method 3: Comprehensive error handling
Dim testValue As Variant
testValue = Range("A1").Value
If IsError(testValue) Then
Select Case Application.WorksheetFunction.Error_Type(testValue)
Case 1
MsgBox "Error: #NULL!"
Case 2
MsgBox "Error: #DIV/0!"
Case 3
MsgBox "Error: #VALUE!"
Case 4
MsgBox "Error: #REF!"
Case 5
MsgBox "Error: #NAME?"
Case 6
MsgBox "Error: #NUM!"
Case 7
MsgBox "Error: #N/A"
End Select
Else
MsgBox "No error: " & testValue
End If
End SubError detection before processing formula results
Data validation to identify cells with errors
Creating robust calculations that handle errors gracefully
Error logging and debugging in complex spreadsheets
Conditional logic based on error presence
Data cleaning operations that need to identify and separate error values
Quality control checks in data import and transformation processes
Building error-tolerant financial models and reports
ISERROR returns FALSE but formula still shows error
Solution: ISERROR checks the value, not the formula itself. If the cell contains a formula that produces an error, ISERROR will return TRUE. Ensure you're checking the correct cell reference and that the formula has been evaluated.
ISERROR with IF evaluates formula twice causing performance issues
Solution: When using =IF(ISERROR(formula), default, formula), Excel evaluates the formula twice. Use IFERROR instead for better performance, or place the formula in a helper cell and reference it in both ISERROR and IF.
ISERROR not detecting expected errors
Solution: Verify the formula actually produces an error type. Some operations return 0, empty strings, or other values instead of errors. Test the formula directly to see what error (if any) it produces.
ISERROR returns TRUE for cells that don't look like errors
Solution: ISERROR checks the actual cell value, not what's displayed. The cell may contain an error value that's being formatted or hidden. Check the formula bar or use ERROR.TYPE to identify the specific error.
Using ISERROR but still seeing error values in results
Solution: ISERROR only detects errors; it doesn't prevent them. You must combine ISERROR with IF to replace error values: =IF(ISERROR(formula), alternative, formula). Alternatively, use IFERROR for simpler syntax.