Back to Patterns
Combo recipe
Beginner

IFERROR + VLOOKUP

Safe lookups with a friendly fallback

When to reach for this

Show "Not found" when a customer ID doesn't exist in the reference table.

=IFERROR(VLOOKUP(A2, Products!A:C, 3, FALSE), "Not found")

What this pattern does

Wraps a VLOOKUP with IFERROR so missing values don't crash your spreadsheet with #N/A. Instead, you choose what users see: a blank cell, a "Not found" message, or a default value.

Interactive walkthrough

Walk through IFERROR

IFERROR wrapped around VLOOKUP is the safest lookup pattern in Excel. Missing rows become readable messages instead of error codes. Watch it handle a missing product, step by step.

Formula anatomy
2 args
=IFERROR(VLOOKUP("P999", A2:C6, 3, FALSE),"Not found")
1
VLOOKUP("P999", A2:C6, 3, FALSE)value

The risky expression, a VLOOKUP that may fail

2
"Not found"value_if_error

The friendly fallback shown when VLOOKUP errors out

Customer_Orders.xlsxStep 1/5
FileHomeInsertPage LayoutFormulasDataReviewView
E2
fx
=IFERROR(VLOOKUP("P999", A2:C6, 3, FALSE)"Not found")
ABCDE
1Product IDNamePrice
2P001Laptop$1,200=IFERROR(VLOOKUP("P999", A2:C6, 3, FALSE), "Not found")
3P002Phone$800
4P003Tablet$450
5P004Monitor$320
6P005Keyboard$80
OrdersProducts+
Enter

You type the combo formula

You want to look up product "P999" but you're not sure if it exists. Bare VLOOKUP would show an ugly #N/A. Wrapping with IFERROR gives a clean fallback.

Key takeaway

Best practice: use "" (empty string) for silent fallback, or a descriptive message like "Not found" for reports. Avoid using 0 as a fallback, it can silently poison downstream sums.

IFERROR + VLOOKUP: Excel Formula Pattern | CellSkill