ExcelUnpackUnpack Excel, one formula at a time.
Log inSign up

Lesson 40 · Lookups

VLOOKUP with IFERROR in Excel

When VLOOKUP can’t find a code, it shows #N/A. Wrap it in IFERROR and you can show "Not found" instead, so the sheet stays easy to read.

Practice this lesson →Pro lesson. The first 4 lessons are free.

What you will learn

  • Catch #N/A from VLOOKUP
  • Show your own message instead

How it works

=IFERROR(VLOOKUP(A2,$F$2:$G$5,2,FALSE),"Not found")

If VLOOKUP works, you see the answer. If not, you see "Not found".

Formulas at a glance

=IFERROR(VLOOKUP(…),"Not found")The pattern to follow

Example

Write the formula to look up the product for code B-2. Show "Not found" if it is missing.

ABCDEFG
1CodeQtyProductCodeProduct
2B-23B-1Book
3B-71B-2Bag
4B-15B-3Bottle
5B-32B-4Box

Click C2 and type =IFERROR(VLOOKUP(A2,$F$2:$G$5,2,FALSE),"Not found"), then press Enter.

The answer is Bag.

When to use it

  • Order sheets where some codes are new
  • Reports for people who don’t know what #N/A means
  • Checking which codes are missing

Common mistakes

  • Putting IFERROR inside VLOOKUPIFERROR goes on the outside.
  • Hiding a typo in the codeCheck the "Not found" rows. The code may be misspelled.
  • Forgetting the quotes on the messageWrite "Not found" in quotes.

Practice it on a real sheet

Reading is a start. Doing it is how it sticks. This lesson walks you through every click on a live spreadsheet and checks each answer.

VLOOKUP with IFERROR in Excel: how it works, with examples · ExcelUnpack