What is the ISERROR function?
=ISERROR(value)ISERROR returns TRUE for any error value, #N/A included. It is most often used inside IF to treat values differently by kind.
Column A of the sheet mixes text, numbers, a blank, a logical value, errors and text that looks like a number; column B says what each is. Column C shows the same formula copied down.
ISERROR is TRUE for any kind of error, so it is the tool for counting errors or highlighting them with conditional formatting. If all you need is to replace errors with another value, IFERROR is shorter today.
Arguments
- value
- The value or cell to test.
ISERROR examples
Example 1. Check for an error
=ISERROR(A6)#N/A, so TRUE.
Example 2. With IF
=IF(ISERROR(B2/C2), 0, B2/C2)Shows 0 if the division fails. Today IFERROR(B2/C2, 0) is shorter.
Example 3. Result for each kind of value
=ISERROR(A2)Every error, #N/A included, is TRUE.
Value in column A =ISERROR(A2) Apple FALSE 120 FALSE (blank) FALSE TRUE FALSE #N/A TRUE #DIV/0! TRUE "120" (text) FALSE Example 4. Count the errors
=SUMPRODUCT(--ISERROR(A2:A10))In A2:A10 the result is 2: #N/A and #DIV/0!.
Common mistakes
Excluding only #N/A
Use ISERR.
Text that looks like a number
According to Microsoft, IS functions test the value without converting it, so "120" stored as text is text, not a number.
Hiding errors without looking
Blanking every error also hides formula mistakes such as #REF!. Count them with ISERROR first, then decide what to replace.
FAQ
- Which errors count?
- According to Microsoft: #N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME? and #NULL!.
- How is it different from IFERROR?
- ISERROR only returns TRUE/FALSE; IFERROR returns a replacement value directly when there is an error.