ExcelFunctions.net Logo

The Excel ISERROR Function

Home » Excel-Built-In-Functions » Excel-Iserror-Function

Search this site:
Custom Search

Basic Description

Related Functions :

The Excel ISERROR function tests if an initial supplied expression (or value) returns an Excel Error, and if so, returns TRUE; Otherwise the function returns FALSE.

The format of the ISERROR function is :

ISERROR( Value )

Where the Value argument can refer to either a direct value, an Excel formula or a cell reference.


Examples

The following spreadsheets show examples, of the Excel ISERROR function being used to determine whether a value or expression returns an error. The spreadsheet on the left shows the formulas used and the spreadsheet on the right shows the results :

Examples of use of the Excel Iserror function Results from the Excel Iserror function

In the examples above, the arguments to the ISERROR function calls are :

  • Simple values in cells B1 - B3
  • Expressions in cells B4 & B5 (note the division by zero in cell B4 will produce the #DIV/0! error)
  • Cell references in cells B6 & B7

For more details of the different types of Excel error messages, see the page on Excel Formula Errors.



The ISERROR Function In VBA

The ISERROR function is also a built-in function in VBA (used for writing Excel Macros).

Within VBA, the function takes exactly the same format as when used in an Excel spreadsheet:

ISERROR( Value )

For example:

Dim  A1Err  As Boolean
A1Err  =  IsError( Cells( 1, 1 ).Value )

After running the above 2 lines of VBA code, the variable 'A1Err' holds the value True if cell A1 of the current worksheet contains an error, and holds the value False otherwise.






Disclaimer Privacy Policy

Copyright © 2008-2010 ExcelFunctions.net