Wednesday, 22 October 2014

IFERROR In Excel


What is IFError?

A common request in the area of functions is something to simplify error checking.

e.g If user wants to catch the errors in VLOOKUP and use their own error text opposed to excel error, they can use IF and ISERROR functions or user can use only IFERROR.

Here are both the examples.

1) In first example we will try to get Name Value from left grid by using IF and ISERROR.
 =IF(ISERROR(VLOOKUP(D5,A$2:B$6,2,FALSE)),"Value is not Availble in Source Table",VLOOKUP(D5,A5:B9,2,FALSE))


 

 2) For same scenario we are using IFERROR.
=IFERROR(VLOOKUP(D7,A2:B7,2,FALSE),"Value is not Availble in Source Table")
 
 
As you can see that both are providing same result, but user need to repeat the VLOOKUP formula twice. This has a number of problems
a) First, it is hard to maintain.. if you have to change the formula you have to do two time
b) Second, it can affect the performance because formulas are quite often run twice.
 
Keep Reading and Happy Diwali
Sanjay Bakshi

 

 

No comments:

Post a Comment