Thursday, 10 July 2014

Excel IFERROR Function(excel 2010)

Microsoft Excel IFERROR Function(excel 2010)

Basic Description

The Excel Iferror function tests if an initial supplied value (or expression) returns an error, and if so, returns a second supplied argument; Otherwise the function returns the initial tested value.
The Iferror function is new to Excel 2007, so is not available in earlier versions of MS Excel
The syntax of the function is:
IFERROR( value, value_if_error )
Where the arguments are as follows :

value-The initial value or expression that should be tested
value_if_error-Value or expression to be returned if the initial value argument returns an error.


Improvement Compared to Excel 2003

The Excel Iferror function was introduced in Excel 2007.
Previously, in Excel 2003, many users of the Excel Vlookup function would combine this with the If function and the Iserror function, to test for an error, and return an appropriate result. This is shown in the following formula:
IF( ISERROR( VLOOKUP( ... ) ), "not found", VLOOKUP( ... ) )

the above formula checks if the Vlookup function returns an error, and if so, returns the text "not found". Otherwise the value returned by the Vlookup is used.
Although this formula is long and inefficient (as it requires 2 seperate calls to the Vlookup function), it is useful because it helps to keep your spreadsheet cells tidy and free from error messages.
In Excel 2007 or 2010, the above action can be performed much more efficiently and neatly, by using the Iferror function. The new formula is written as:
IFERROR( VLOOKUP( ... ), "not found" )
This is illustrated in the example below.

Iferror Function Examples

The following spreadsheet shows two examples of the Excel Iferror function. The formulas are shown in the top spreadsheet and the results are shown in the spreadsheet below.
 Formulas:
ABC
1BethClass 1=IFERROR( VLOOKUP( "Jim", A1:B5, 2 FALSE ), "not found" )
2BobClass 2=IFERROR( VLOOKUP( "Mary", A1:B5, 2 FALSE ), "not found" )
3AlfClass 2
4JimClass 3
5AnnClass 3
 Results:
ABC
1BethClass 1Class 3
2BobClass 2not found
3AlfClass 2
4JimClass 3
5AnnClass 3

No comments:

Post a Comment