You are here:

Excel/Iserror and vlookup function


I am trying to understand the below formula.
=IF(ISERROR(VLOOKUP(B3, '3.4.2015'!B:C, 2, FALSE)), 0, VLOOKUP(B3, '3.4.2015'!B:C, 2, FALSE))

I am not an expert so please help me to understand below questions.
1. I have not used ISERROR formula before so if you can please explain what formula does?
2. Benefit of this formula vs. Vlookup.
3. Also, I am trying use the formula by changing reference option "3.4.2015" to different reference and it is not working, without changing anything else int he formula.

Your help is appreciated.

Thanks in advance for your help.


Is error is the condition passed to the IF statement.  If vlookup can't find the value being lookedup, it returns a #NA error.  Rather than display that error the formula is designed to show a zero.

If if does not return an error, it means it was successful.  Then the vlookup function is executed again and the returned value is displayed.

A new function call IFERROR was added in Excel 2007 and later.  It avoids doing to Vlookups.  

IFERROR(VLOOKUP(B3, '3.4.2015'!B:C, 2, FALSE),0)

would be equivalent to your formula.

'3.4.2015'  would refer to your sheet name where the data is.  You should be able to replace it with any valid sheet name.  The easiest thing to do would be to select the formula in the formula bar, highlight the just the '3.4.2015'!B:C

then navigate to the new sheet and select the two columns and hit enter.

this should put the new reference in the formula. You would do this twice with the original formula or just copy the new reference and replace the old reference in the other part of the formula.

Tom Ogilvy  
About Excel
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here


All Answers

Answers by Expert:

Ask Experts


Tom Ogilvy


Selected as an Excel MVP by Microsoft since 1999. Answering Excel questions in Allexperts since its inception in 2001. Able to answer questions on almost all aspects of Excel's internal capabilities. If seeking a VBA solution, please specify that in your question itself so I give you the answer you want. [Excel has weak protection - if you are distributing an application, I don't answer questions on how to protect your project from your users.]


Extensive experience.

Master of Science (MS) degree Operations Research (ORSA)

Awards and Honors
Microsoft MVP in Excel.

©2016 All rights reserved.