IFERROR

  • Thread starter Thread starter MMCBRIDE
  • Start date Start date
If you are human just like us, sooner or later you will make an errort and
will need this function...

Seriously, ISERROR is used to suppress or take an alternate action if the
formula being tried generates and error. It is also used when many functions
are used together to build a large one. If any piece retruns an error the
whole fails. By testing for ISERROR one can recover from such situations.
 
MMCBRIDE said:
Why would I ever need this function?

'Need'? Never. However, IFERROR could be efficient and convenient.
Formulas like

=IF(ISERROR(VLOOKUP(a,Table,n,0)),a&" not found in
table",VLOOKUP(a,Table,n,0))

in Excel 2003 and prior could be rewritten as

=IFERROR(VLOOKUP(a,Table,n,0)),a&" not found in table")

in Excel 2007.
 
IFERROR is one of the few improvements between 2003 and 2007 IMHO.

Let's say we have a formula that returns an error and one of the most common
methods to deal with this is

=IF(ISERROR(formula),0,formula)

remember that the word formula here can be the equivalent of a gigantic
formula thus making the above example a monstrosity, first the IF, then
ISERROR, then the long formula, then what we want if it's an error and
finally the same long formula again.

Using IFERROR it will look like


=IFERROR(formula,0)


so we save the IF and 1 formula string plus 2 function calls which is
actually very good.

--


Regards,


Peo Sjoblom
 
Back
Top