In Excel: wrap VLOOKUP in IFERROR to suppress lookup errors — =IFERROR(VLOOKUP(E2,A:B,2,FALSE),"Not found") returns "Not found" when the lookup value is absent instead of showing #N/A.
On this page8
Formula: IFERROR with VLOOKUP
Identify the lookup value (e.g. E2), the lookup range (e.g. A:B), and the column index of the return value (e.g. 2 for column B).
Write the base VLOOKUP: =VLOOKUP(E2,A:B,2,FALSE)
Wrap with IFERROR: =IFERROR(VLOOKUP(E2,A:B,2,FALSE),"Not found")
Choose a meaningful fallback — "" for a blank cell, 0 for numeric aggregates, or a descriptive string.
Press Enter and copy down. Test with a value known to be absent to confirm the fallback appears.
If only #N/A should be suppressed (not other VLOOKUP errors), use IFNA() instead of IFERROR().
What this does
Combining IFERROR with VLOOKUP is the standard pattern for lookup formulas that must handle missing values gracefully. VLOOKUP returns #N/A when the search value is not found in the lookup column; wrapping it in IFERROR intercepts that error and returns a friendly fallback value instead — an empty string, zero, or a descriptive message like "Not found". This keeps downstream formulas and reports from propagating the error. IFNA() is a more precise alternative that catches only #N/A errors (not formula syntax errors), but IFERROR(VLOOKUP(…), fallback) is the most widely-used pattern and works in all Excel versions that support VLOOKUP. Keep the inputs visible and clearly labelled and the whole thing stays auditable — anyone who opens the file later, including you, can see at a glance exactly what feeds the result and change one assumption without hunting through the formula. Treat “iferror vlookup” as a small repeatable workflow rather than a one-off click you hope to remember next time. Use a small test block before the live file, so any surprise in the affected cells shows up while it is still harmless. When this is a ribbon command, the selection matters more than the button: confirm the range, apply the command, then spot-check the output before saving. That turns a data step that keeps your analysis trustworthy into a method you can reuse, explain, and defend when the workbook leaves your screen.
A worked example
Scenario: column A has product IDs, column B has prices, and cell E2 contains a product ID you are looking up. The formula =IFERROR(VLOOKUP(E2,A:B,2,FALSE),"Not found") searches column A for the value in E2 and returns the corresponding price from column B. If E2 contains a product ID not in column A, VLOOKUP would return #N/A; IFERROR intercepts it and shows "Not found" instead. To debug a missing match: temporarily remove IFERROR to see the raw #N/A, then use =COUNTIF(A:A,E2) to confirm whether the value exists in the lookup range. Wrap every production VLOOKUP in IFERROR (or IFNA) before sharing the workbook. A bare VLOOKUP that hits a missing key will cascade #N/A through every dependent cell, breaking totals, conditional formats, and charts. The one-second effort of adding IFERROR around the formula prevents those downstream failures and keeps the workbook usable even when input data is incomplete. One habit worth forming early: name the cells that hold your inputs, so the formula reads in plain language instead of a string of cell addresses. A reviewer — or you in three months — can then follow the logic without decoding what B7 and D2 were supposed to mean, which is most of what makes a sheet maintainable.
In Google Sheets
Some functions on this page are newer additions to Excel: they are in current Microsoft 365 and Excel for the web, while older perpetual Excel versions return #NAME?. Google Sheets maintains its own function list, so confirm each function exists there before relying on the same formula. Nothing on this page is behind a login or a download: the exact answer is at the top, and the detail below it is there for when you need it. That is the whole promise here — the answer first, and just enough context to make it stick. Here is the takeaway for “iferror vlookup”: copy the answer if you are busy, but if you have a spare few minutes, rebuild the example in Excel yourself with the tool above open beside it. That single pass — type it, run it, watch the result move when you change an input — is what turns a formula you found into a technique you trust. Keep your inputs labelled and referenced, never hard-coded, and the same sheet stays correct and auditable as it grows. Done that way, you will not need to look this up again, and you will be the person others ask.
Common mistakes
- Using
IFERRORto hide a configuration error — ifVLOOKUPreturns#REF!or#VALUE!(wrong column index, wrong range)IFERRORsilently hides the bug. Test the rawVLOOKUPfirst before addingIFERROR. - Setting the fallback to 0 when the result feeds into an average or ratio — zeros silently distort aggregates. Use "" or "N/A" for qualitative lookups, or
IFNAto suppress only#N/A. - Forgetting FALSE as the fourth argument —
VLOOKUPwith TRUE (approximate match) searches a SORTED column; on an unsorted column it returns wrong results without an error, andIFERRORnever fires because there is no error to catch.
Frequently asked questions
What is the difference between IFERROR and IFNA for VLOOKUP?
IFNA catches only #N/A errors (the "not found" signal from lookup functions). IFERROR catches any error including #REF!, #VALUE!, and #N/A. Use IFNA when you only want to handle the "not found" case and want other formula errors to remain visible for debugging.
Can I use IFERROR with XLOOKUP instead of VLOOKUP?
XLOOKUP has a built-in fourth argument for the "not found" result: =XLOOKUP(E2,A:A,B:B,"Not found"). This is cleaner than wrapping in IFERROR. Use XLOOKUP in Excel 365/2021+ for new formulas; keep IFERROR(VLOOKUP(…)) for backward compatibility.
Why does my IFERROR(VLOOKUP(…)) return the fallback even when the value exists?
The value probably exists but does not match exactly. Common causes: hidden spaces (fix with TRIM()), data-type mismatch (lookup value is a number, the column stores text — fix with VALUE() or TEXT()), or trailing characters. Remove IFERROR temporarily to see the raw VLOOKUP error, then diagnose.