ExcelReady
CourseMock testsFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before day one. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Mock tests
  • Function guides
  • Blog

Test prep

  • Excel level test
  • Excel test practice
  • Free screening quiz
  • Certificate

Company

  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Logic
  3. IFERROR With VLOOKUP: Replace #N/A With a Message

IFERROR With VLOOKUP: Replace #N/A With a Message

By ExcelReady Team·Updated November 1, 2026·6 min read

The short answer

To replace #N/A from VLOOKUP, wrap it in IFERROR: =IFERROR(VLOOKUP(E2,$A$2:$C$6,3,FALSE),"Not found"). If VLOOKUP finds the value, you see the result; if it returns any error, you see Not found instead. Use IFNA instead of IFERROR when you only want to catch missing values and still see other mistakes.

Key takeaways

  • The pattern is =IFERROR(VLOOKUP(...),"Not found"): the lookup first, then what to show on an error.
  • The second argument can be text, 0, or "" for a cell that looks blank.
  • IFERROR hides every error, including #REF! from a wrong column number; IFNA hides only #N/A.
  • Chain lookups with IFERROR to search a second table when the first has no match.
  • In Excel 2021 or Microsoft 365, XLOOKUP has its own if_not_found argument.
On this page+
  1. Why does VLOOKUP return #N/A?
  2. How to write the IFERROR VLOOKUP formula
  3. What to show instead of #N/A
  4. Why IFERROR can hide real mistakes
  5. IFNA: the safer choice for lookups
  6. How to search a second table when the first has no match
  7. Other ways to handle missing values
  8. IFERROR VLOOKUP down a whole column
  9. Practise it

IFERROR with VLOOKUP replaces the #N/A error you get when a lookup value is missing with something friendlier, such as "Not found", 0 or a blank cell. You wrap the whole VLOOKUP inside IFERROR and add the value to show instead. This guide shows the formula step by step, the three most useful replacement values, and when IFNA is the better choice.

Why does VLOOKUP return #N/A?#

VLOOKUP returns #N/A ("not available") when it can't find the lookup value in the first column of the table. Here is a price list in A1:C6:

ABC
1CodeProductPrice
2P-101Notebook3.50
3P-102Pen1.20
4P-103Stapler8.99
5P-104Folder2.40
6P-105Marker1.75

With P-103 in E2, =VLOOKUP(E2,A2:C6,3,FALSE) returns 8.99. Change E2 to P-109, a code that isn't in the list, and the same formula shows #N/A. That is correct behaviour, but a column full of #N/A looks broken, and any SUM that includes it also returns #N/A. If VLOOKUP itself is new, start with VLOOKUP step by step.

How to write the IFERROR VLOOKUP formula#

IFERROR checks a formula and, if it returns any error, shows a value you choose instead:

Excel formula
=IFERROR(value, value_if_error)

To use it with VLOOKUP, put the whole lookup in the first argument:

Excel formula
=IFERROR(VLOOKUP(E2,A2:C6,3,FALSE),"Not found")

The easiest way to type it:

  1. Write and test the VLOOKUP on its own first: =VLOOKUP(E2,A2:C6,3,FALSE).
  2. Click in the formula bar just after the = and type IFERROR(.
  3. Click at the very end and type ,"Not found").
  4. Press Enter.

With P-103 in E2, the cell still shows 8.99. With P-109, it now shows Not found. If you plan to fill the formula down, lock the table first: $A$2:$C$6. The IFERROR function guide and the VLOOKUP function guide list every argument.

What to show instead of #N/A#

The second argument of IFERROR can be any value. Pick it based on what happens to the result next:

Second argumentFormulaShowsBest for
A message=IFERROR(VLOOKUP(E2,A2:C6,3,FALSE),"Not found")Not foundReports people read
Zero=IFERROR(VLOOKUP(E2,A2:C6,3,FALSE),0)0Results that get added up
Empty text=IFERROR(VLOOKUP(E2,A2:C6,3,FALSE),"")(looks blank)Forms and templates

Be careful with 0. A price of 0 looks like a real price, so a reader can't tell "missing" from "costs nothing". A message is clearer unless the cell feeds a total. The empty-text version looks blank, but the cell still holds a formula, so COUNTA counts it.

Why IFERROR can hide real mistakes#

IFERROR catches every error, not only #N/A. That includes errors that mean your formula is wrong:

  • =IFERROR(VLOOKUP(E2,A2:C6,4,FALSE),"Not found") asks for column 4 of a 3-column table. VLOOKUP returns #REF!, and IFERROR turns it into "Not found", even for codes that exist.
  • A typo in a sheet or range name causes #NAME? or #REF!, which also gets hidden.

So "Not found" may really mean "this formula is broken". When a result looks wrong, delete the IFERROR part for a moment and see the real error. The guide to IFERROR in Excel explains which errors you should never hide.

IFNA: the safer choice for lookups#

IFNA works like IFERROR but only catches #N/A, the error for "value not found". Every other error still shows, so you notice when the formula itself is broken:

Excel formula
=IFNA(VLOOKUP(E2,A2:C6,3,FALSE),"Not found")

For a missing code, IFNA shows Not found, just like IFERROR. For the column-4 mistake above, IFNA shows #REF!, which tells you to fix the column number. IFNA is available in Excel 2013 and later. The comparison of IFERROR vs IFNA goes through more cases.

How to search a second table when the first has no match#

IFERROR's second argument can be another formula, so you can chain lookups. If a code isn't in the current price list in A2:C6, look in an older list in H2:J6:

Excel formula
=IFERROR(VLOOKUP(E2,A2:C6,3,FALSE),IFERROR(VLOOKUP(E2,H2:J6,3,FALSE),"Not found"))

Excel tries the first table. If that fails, it tries the second. If both fail, it shows Not found. Keep chains short: two or three lookups are easy to follow, while longer chains are hard to check. Combining the lists into one table is often the better long-term fix.

Other ways to handle missing values#

Newer lookup functions have this built in. In Excel 2021 and Microsoft 365, XLOOKUP's fourth argument is the value to show when nothing matches, and it only applies to missing values:

Excel formula
=XLOOKUP(E2,A2:A6,C2:C6,"Not found")

INDEX with MATCH can be wrapped in IFERROR or IFNA exactly like VLOOKUP. The article on VLOOKUP vs INDEX MATCH compares the two, and VLOOKUP vs HLOOKUP covers tables laid out across rows instead of down columns.

If IFERROR shows "Not found" for a code you can see in the table, the lookup is failing for a hidden reason. Check for extra spaces (TRIM fixes them), numbers stored as text, and a table range that doesn't start at the lookup column.

IFERROR VLOOKUP down a whole column#

In a real sheet you usually look up a whole column of codes, not one. Say the codes to find are in E2:E20. Lock the table with $ signs and fill the formula down from F2 (Windows: Ctrl+D; Mac: ⌘D):

Excel formula
=IFERROR(VLOOKUP(E2,$A$2:$C$6,3,FALSE),"Not found")

E2 has no $, so it moves to E3, E4 and so on, while the table stays put. Then count the misses in one cell:

Excel formula
=COUNTIF(F2:F20,"Not found")

This tells you at a glance how many codes need attention. To see which ones, turn on a filter (Data > Filter) and show only "Not found" in column F. Fixing those codes, rather than just hiding the errors, keeps the data clean.

Practise it#

IFERROR around VLOOKUP is a classic job-test task because it combines two skills in one formula. Practise VLOOKUP in a live spreadsheet until the four arguments feel automatic, then practise IFERROR to wrap it cleanly. Each lesson checks your formula instantly. Or try the exercise on this page first.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

Code P-109 in E2 is not in the price list. In F2, look up its price (column 3 of A2:C6) with an exact-match VLOOKUP, and wrap it in IFERROR so the cell shows Not found.

fx
ABCDEFG
1
Code
Product
Price
Find code
Price
2
P-101
Notebook
3.5
P-109
3
P-102
Pen
1.2
4
P-103
Stapler
8.99
5
P-104
Folder
2.4
6
P-105
Marker
1.75
7
8
9

Tip: Write the VLOOKUP first: VLOOKUP(E2,A2:C6,3,FALSE). Then put =IFERROR( in front and ,"Not found") at the end.

Practise this in a lesson

LessonIFERRORReplace ugly errors like #DIV/0! with a clean fallback value using IFERROR, and learn when hiding errors backfires.LessonVLOOKUP exact matchPull product names and prices from a catalog with VLOOKUP, and lock the table so the formula fills down cleanly.Function guideIFERRORUse IFERROR to swap #N/A, #DIV/0! and other errors for a clean value. Examples with division and VLOOKUP, pitfalls, and live practice.Function guideVLOOKUPLearn VLOOKUP with clear examples, the 4 most common mistakes, and a live practice exercise you can try in your browser.

Frequently asked questions

How do I use IFERROR with VLOOKUP?

+

Put the whole VLOOKUP inside IFERROR and add the value to show on an error: =IFERROR(VLOOKUP(E2,A2:C6,3,FALSE),"Not found"). Excel returns the lookup result when it works and Not found when it fails.

How do I make VLOOKUP return blank instead of #N/A?

+

Use empty quotes as the second argument of IFERROR: =IFERROR(VLOOKUP(E2,A2:C6,3,FALSE),""). The cell looks empty when there is no match, but it still holds a formula.

How do I make VLOOKUP return 0 instead of #N/A?

+

Use 0 as the second argument: =IFERROR(VLOOKUP(E2,A2:C6,3,FALSE),0). This is useful when the result feeds into a SUM, because SUM fails if any cell holds #N/A.

Should I use IFERROR or IFNA with VLOOKUP?

+

IFNA is usually safer. It only replaces #N/A, the error for a missing value, so a broken formula still shows #REF! or #VALUE! and you can fix it. IFERROR hides all errors.

Why does IFERROR VLOOKUP show Not found when the value is in the table?

+

VLOOKUP is still failing, and IFERROR is hiding why. Check for extra spaces, numbers stored as text, or a table range that doesn't start at the lookup column. Remove IFERROR for a moment to see the real error.

Sources

  • IFERROR function - Microsoft Support
  • VLOOKUP function - Microsoft Support
  • IFNA function - Microsoft Support

Written and checked by the ExcelReady Team. First published November 1, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. Why does VLOOKUP return #N/A?
  2. How to write the IFERROR VLOOKUP formula
  3. What to show instead of #N/A
  4. Why IFERROR can hide real mistakes
  5. IFNA: the safer choice for lookups
  6. How to search a second table when the first has no match
  7. Other ways to handle missing values
  8. IFERROR VLOOKUP down a whole column
  9. Practise it

Keep reading

Logic· 6 min read

IFERROR in Excel: Hide Errors the Right Way

IFERROR returns a formula's normal result, or a value you choose if the formula gives an error: =IFERROR(value, value_if_error). For example, =IFERROR(B2/C2,0) shows 0 instead of #DIV/0!. It catches every error type, including mistakes in your own formula, so check the formula works first, and use IFNA for lookups.

Lookups· 6 min read

VLOOKUP in Excel: Step-by-Step for Beginners

VLOOKUP finds a value in the first column of a table and returns a value from the same row in another column. Write =VLOOKUP(what to find, table, column number, FALSE). FALSE means exact match, which is what you want for IDs, codes and names. If nothing matches, VLOOKUP returns #N/A.

Comparisons· 7 min read

IFERROR vs IFNA: Which Should You Use?

Use IFNA around lookups such as VLOOKUP, MATCH and INDEX MATCH: it replaces only #N/A ("not found"), so real mistakes like #REF! still show. Use IFERROR when other errors are expected and harmless, such as #DIV/0! from dividing by zero. IFERROR hides every error, including your own typos, so use it with care.

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback, right in your browser. Nothing to download.

Start learning for free