Excel: IsError Function
In Excel, the IsError function can be used to check for error values.
The syntax for the IsError function is:
IsError( value )
value is the value that you want to test. If value is an error value (#N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME? or #NULL), this function will return TRUE. Otherwise, it will return FALSE.
Applies To:
- Excel 2007, Excel 2003, Excel XP, Excel 2000
For example:
Let's take a look at an example:

Based on the Excel spreadsheet above:
=IsError(A1) would return TRUE. =IsError(A2) would return TRUE. =IsError(A3) would return TRUE. =IsError(A4) would return FALSE. =IsError("Tech on the Net") would return FALSE. =IsError(3/0) would return TRUE.
VBA Code
The IsError function can also be used in VBA code. For example:
Dim LReturnValue as Boolean
LReturnValue = IsError(CustomFunction())
In this example, the variable called LReturnValue would now contain whether the call to the CustomFunction resulted in an error.
Frequently Asked Questions
Question: Can you give me specific examples of when and how the IsError function is used. Specifically, in a worksheet why would I use this function instead of just running down a column or across a row to look for the errors?
Answer: Often times your spreadsheet contains a large amount of formulas which will not properly calculate when an error is encountered. The IsError function, in combination with the If function, can be used to default a cell's value when an error is occurred. This allows your formulas to evaluate properly without your intervention.
For example, you may encounter a scenario below:

Instead of using the formula:
=B4/C4
You could use the IsError function as follows:
=IF(ISERROR(B4/C4),0,B4/C4)

In this case, the IsError function would allow you to return a 0, when an error was encounter such as a "divide by 0 error". Now all of your formulas will still work.
