Handle missing SKUs in a lookup (IFERROR)
The problem
Problem statement
Customer service forwarded an order list, and one of the SKUs was discontinued — it is not in the price list (A2:C6) anymore, so a plain lookup would blow up with an error in the middle of your report. Fill the Unit price cells F2:F4 so every order row either shows the matched price or the text Not found.
Wrap the lookup rather than replacing it — case 2 is a discontinued SKU and must show "Not found" instead of #N/A.
Problem data
Show the sheet as a table (selectable, copyable)
| A | B | C | E | F | |
|---|---|---|---|---|---|
| 1 | SKU | Product | Unit price | Order SKU | Unit price |
| 2 | SKU-101 | Keyboard | 199 | SKU-103 | |
| 3 | SKU-102 | Mouse | 89 | SKU-999 | |
| 4 | SKU-103 | Monitor | 899 | SKU-101 | |
| 5 | SKU-104 | Laptop stand | 149 | ||
| 6 | SKU-105 | USB hub | 259 |
Notes
IFERROR(value, value_if_error) wraps any formula and replaces its errors (#N/A, #REF!, #DIV/0!) with a fallback. Scoping note: it also hides genuine mistakes like a typo'd range, so use it at the edges of a report, not while debugging.
How to approach
Your answer goes in F2:F4. On submit we re-run your formula against 3 different sets of input, so a hardcoded number will fail — the formula has to follow the cells.
- Target cells are F2:F4 — start in F2, then fill down
- Build the working lookup first: E2 against the price table A2:C6, price in column 3
- Then wrap the whole lookup in a function that catches errors
- The fallback text is "Not found" — quotes required
Official solutions
Show 2 solutions — try it yourself first
Approach 1: IFERROR around VLOOKUP
=IFERROR(VLOOKUP(E2, A2:C6, 3, FALSE), "Not found")
The VLOOKUP runs first. If the SKU is missing, it raises #N/A; IFERROR catches that and returns the text "Not found" instead. Fill down through F4.
Approach 2: IFNA for lookup misses only
=IFNA(VLOOKUP(E2, A2:C6, 3, FALSE), "Not found")
IFNA catches only #N/A — the 'not found' error — and lets other errors (typos, broken references) surface loudly. Often the better choice in production reports.
Function guide
FAQ
How do I hide #N/A from VLOOKUP?
Wrap it: =IFERROR(VLOOKUP(E2, A2:C6, 3, FALSE), "Not found"). When the lookup misses, IFERROR returns the fallback text instead of the error.
IFERROR or IFNA — which should I use?
IFNA only catches #N/A (missing lookup values) and still surfaces other errors. IFERROR silences every error, which can mask real mistakes. For lookup fallbacks, IFNA is the more precise tool.
Does IFERROR slow down large sheets?
Marginally — it evaluates the inner formula and checks the result. On report-sized ranges it is negligible; on whole-column array formulas it adds up.