Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or

How to VLOOKUP and return zero instead of #N/A in Excel?

doc-vlookup-return-zero-1
In Excel, it appears #N/A when it cannot find the relative correct result by using VLOOKUP formula. But in sometimes, you want to return zero instead of #N/A when using VLOOKUP function which may make the table look much nicer. This tutorial is talking about returning zero instead of #N/A when using VLOOKUP.
Return zero instead of #N/A when using VLOOKUP
Return zero instead of all #N/A with Kutools for Excel good idea3

Error Condition Wizard

If there are multiple types of errors in a sheet, and you want to convert these errors to empty or other values, you can apply Kutools for Excel's Error Condition Wizard to quicky handle this task.
Click for 60 days free trial!
doc ignore errors 3
 
Kutools for Excel: with more than 300 handy Excel add-ins, free to try with no limitation in 60 days.

arrow blue right bubble Return zero instead of #N/A when using VLOOKUP


To return zero instead of #N/A when the VLOOKUP function cannot find the correct relative result, you just need to change the ordinary formula to another one in Excel.

Select the cell you want to use VLOOKUP function, and type this formula =IFERROR(VLOOKUP(A13,$A$2:$C$10,3,0),0), drag the autofill handle to the range you need. See screenshot:
doc-vlookup-return-0-2

Tips:
(1) In the above formula, A13 is the lookup value, A2:C10 is the table array range, and 3 is the index column number. The last 0 is the value you want to show when the VLOOKUP cannot find the relative value.
(2) This method will replace all kinds of errors with the number 0, including #DIV/0, #REF!, #N/A, etc.


arrow blue right bubble Return zero instead of all #N/A with Kutools for Excel

With Kutools for Excels Error Condition Wizard utility, you can quickly replace all #N/A with zero in a worksheet.

Kutools for Excel, with more than 300 handy functions, makes your jobs more easier. 

After installing Kutools for Excel, please do as below:(Free Download Kutools for Excel Now!)

1. Select a range where you want to replace the #N/A errors with 0, and click Kutools > More > Error Condition Wizard. See screenshot:

doc error condition wizard

2. Then in the popping dialog, select Only the #N/A error value from the Error types drop down list, and check A message (text), then type 0 into the next text box. See screenshot:

doc-vlookup-return-0-4

3. Click Ok. Then all #N/A errors will be replaced with 0.

Tip: This utility will instead all #N/A errors of 0 not only the #N/A in VLOOKUP formula.

Click here to know more about Error Condition Wizard.


Select Cells with Error Value 

Click for 60 days free trial!
doc count error value
 
Kutools for Excel: with more than 300 handy Excel add-ins, free to try with no limitation in 60 days.

Relative Articles:


Recommended Productivity Tools

Ribbon of Excel (with Kutools for Excel installed)

300+ Advanced Features Increase Your Productivity by 71%, and Help You To Stand Out From Crowd!

Would you like to complete your daily work quickly and perfectly? Kutools For Excel brings 300+ cool and powerful advanced features (Combine workbooks, sum by color, split cell contents, convert date, and so on...) for 1500+ work scenarios, helps you solve 82% Excel problems.

  •  Deal with all complicated tasks in seconds, help to enhance your work ability, get success from the fierce competition, and never worry about being fired.
  •  Save a lot of work time, leave much time for you to love and care the family and enjoy a comfortable life now.
  •  Reduce thousands of keyboard and mouse clicks every day, relieve your tired eyes and hands, and give you a healthy body.
  •  Become an Excel expert in 3 minutes, and get admiring glance from your colleagues or friends.
  •  No longer need to remember any painful formulas and VBA codes, have a relaxing and pleasant mind, give you a thrill you've never had before.
  •  Spend only $39, but worth than $4000 training of others. Being used by 110,000 elites and 300+ well-known companies.
  •  60-day unlimited free trial. 60-day money back guarantee. Free upgrade and support for 2 years. Buy once, use forever.
  •  Change the way you work now, and give you a better life immediately!

Office Tab Brings Efficient And Handy Tabs to Office (include Excel), Just Like Chrome, Firefox, And New IE

  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Open and create documents in new tabs of same window, rather than in new windows.
  • Help you work faster and easily stand out from the crowd! One second to switch between dozens of open documents!
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    Anonymous · 4 months ago
    Thank you very much
  • To post as a guest, your comment is unpublished.
    Yamin · 6 months ago
    Thank you....
  • To post as a guest, your comment is unpublished.
    Steven B · 1 years ago
    how do you write this is VBA code though?

    =IFERROR(VLOOKUP(A13,$A$2:$C$10,3,0)


    If (shtdest.Range("E" & ii)) = "N/A" Then
    replace with "0"



    is not working
    • To post as a guest, your comment is unpublished.
      Sunny · 1 years ago
      Sorry I do not know how to rewrite your code, why do not use above easy methods to solve?
  • To post as a guest, your comment is unpublished.
    Rajnikant sarraf · 1 years ago
    If you want to display your own error comments then do following in a vlookup command.

    =IFERROR(VLOOKUP(A13,$A$2:$C$10,3,0),"your comments"), drag the autofill handle to the range.

    It will show 'your comments' instead of #N/A.
  • To post as a guest, your comment is unpublished.
    Rashad Jalilov · 2 years ago
    Thank you very much very useful) ;-)