If(iserror

StrideExcel

New Member
Joined
Jan 28, 2008
Messages
13
Just curious what the difference is between the following formulas:

if(iserror(
iferror(
if(isna(

they seem to return the same result


Thanks
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

schielrn

Well-known Member
Joined
Apr 4, 2007
Messages
6,939
The first 2 will return the same results, but you only need to use the formula you are checking once. Like:

=if(iserror(vlookup(A1,B:D,3,0)),0,vlookup(A1,B:D,3,0))

but with iferror it is much shorter:

=iferror(vlookup(A1,B:D,3,0),0)

So I would assume the latter would calculate quicker, but is only available in XL2007.

=if(isna( is like the first one, but will only check for a #N/A error and will not work for #VALUE, #NUM, #DIV/0 and #NAME?.

Hope that helps.
 

mgirvin

Well-known Member
Joined
Dec 15, 2005
Messages
1,216
Dear StrideExcel,

ISERR checks for: #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME?, #NULL
ISERROR checks for: #N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME?, #NULL
ISNA checks for: #N/A

And as schielrn said, IFERROR is a great new function in Excel 2007 that is shorter to type and calculates much faster in some large formulas!
 

jbeaucaire

Well-known Member
Joined
May 8, 2002
Messages
6,012
IFERROR can be added to earlier versions of Excel with a UDF, if you're interested or in need.

Code:
Function IFERROR(ToEvaluate As Variant, Default As Variant) As Variant
    If IsArray(ToEvaluate) Then
        IFERROR = IIf(IsError(ToEvaluate(1)), Default, ToEvaluate)
    Else
        IFERROR = IIf(IsError(ToEvaluate), Default, ToEvaluate)
    End If
End Function
 

Watch MrExcel Video

Forum statistics

Threads
1,129,752
Messages
5,638,157
Members
417,011
Latest member
Amaden95

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top