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 or other specific text instead of #N/A by using advanced VLOOKUP good idea3
Convert all #N/A error value to zero or other text

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.


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 30 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 30 days.

arrow blue right bubble Return zero or other specific text instead of #N/A by using advanced VLOOKUP

With Kutools for Excels Super LOOKUP utilities group, you can lookup values from right to left (or left to right), lookup value across multiple worksheets, lookup values from bottom to top ( or top to bottom), and lookup value and sum, and lookup between two value, all of them support to replace #N/A error value with other text. In this case, I take the LOOKUP from Right to Left for instance.

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. Click Kutools > Super LOOKUP > LOOKUP from Right to Left.
doc-vlookup-return-0-2

2. In the LOOKUP from Right to Left dialog, do as below step:

1) Select the lookup value range and output range, check Replace #N/A error value with a specified value checkbox, and then type zero or other text you want to display in the textbox.

2) Then select the data range includes or excludes the headers, specify the key column(lookup column) and the return column.
doc vlookup return 0 6

3. Click OK. The values have been returned based on the lookup value, and the #N/A errors are also replaced by zero or the new text.
doc vlookup return 0 7


arrow blue right bubble Convert all #N/A error value to zero or other text

If you want to change all #N/A error values to zero, not only in VLOOKUP formul, you can apply Kutools for Excel’s Error Condition Wizard utility.

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 vlookup return 0 8

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.


Select Cells with Error Value 

Click for 30 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 30 days.

Relative Articles:


Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%

  • Reuse: Quickly insert complex formulas, charts and anything that you have used before; Encrypt Cells with password; Create Mailing List and send emails...
  • Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range...
  • Merge Cells/Rows/Columns without losing Data; Split Cells Content; Combine Duplicate Rows/Columns... Prevent Duplicate Cells; Compare Ranges...
  • Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
  • Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
  • Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
  • Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
  • Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
  • More than 300 powerful features. Supports Office/Excel 2007-2019 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features 30-day free trial.
kte tab 201905

Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
officetab bottom
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.
    Saurabh · 3 months ago
    very useful info. was struggling with getting the zero. thanks guys. you are my Batmen.
  • To post as a guest, your comment is unpublished.
    Anonymous · 10 months ago
    Thank you very much
  • To post as a guest, your comment is unpublished.
    Yamin · 1 years ago
    Thank you....
  • To post as a guest, your comment is unpublished.
    Steven B · 2 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 · 2 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 · 2 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) ;-)