IFERROR VLOOKUP in Excel: How to Use It
In this article
Wrap VLOOKUP in IFERROR and you get a clean result instead of an ugly #N/A when the lookup value is missing. The pattern is simple: =IFERROR(VLOOKUP(lookup_value, table_array, col_index_num, FALSE), "Not found"). IFERROR runs the VLOOKUP first; if it returns any error, Excel shows your fallback instead. That single change makes reports readable and stops errors from cascading into SUM, AVERAGE, or chart formulas downstream.
This guide assumes you already have a table of data and a lookup value. The steps work the same in Excel for Microsoft 365, Excel 2021, and Excel 2019, on Windows and Mac. Menu labels can differ slightly by version and region, but the formula syntax is identical.
What You'll Need
- Excel 2019 or later, or Microsoft 365 (IFERROR exists in Excel 2007 onward, but VLOOKUP behavior is the same).
- A source table with the lookup column on the left and the return column to its right.
- A cell containing the value you want to look up, or a hard-coded value in the formula.
- Basic familiarity with cell references and the formula bar.
Step-by-Step
- Identify your lookup value. This is the piece of information you know, such as an employee ID, product code, or customer name. Put it in a cell (for example A2) so you can change it later without editing the formula.
- Confirm the source table layout. VLOOKUP searches the leftmost column of the range you give it and returns a value from a column to the right. If your lookup column is not the first column of the range, either rearrange the data or use INDEX and MATCH instead. VLOOKUP cannot look left.
- Decide the column index number. Count from the first column of your range. If the range is B2:E100 and you want the value in column D, the index is 3 (B=1, C=2, D=3, E=4).
- Write the VLOOKUP on its own first. In an empty cell, type
=VLOOKUP(A2, B2:E100, 3, FALSE). The FALSE argument forces an exact match, which is what you almost always want. Press Enter and check that it returns the right value for a known lookup. - Wrap it in IFERROR. Edit the formula to read
=IFERROR(VLOOKUP(A2, B2:E100, 3, FALSE), "Not found"). The second argument is what Excel shows when the VLOOKUP produces an error. Press Enter. - Choose a sensible fallback. Use an empty string
""to leave the cell blank, a short text label like"Missing", or a zero if the column feeds a numeric total. Avoid putting a long sentence in the fallback if the column is used in charts or pivot tables. - Test the error path. Type a value into A2 that you know is not in the source table. The cell should now show your fallback text instead of #N/A. Change A2 back to a valid value and confirm the correct result returns.
- Copy the formula down. Drag the fill handle or copy and paste the cell down the column. If you plan to copy across columns, lock the range with dollar signs:
$B$2:$E$100. Otherwise the range will shift and return wrong values. - Check the results against a few known rows. Pick three or four lookup values, find them manually in the source table, and confirm the formula returns the same answer. This catches off-by-one column index mistakes before they spread.
Common Mistakes
- Using TRUE or omitting the fourth argument. Approximate match is the default, and it returns wrong values on unsorted data without any error. Always type FALSE (or 0) for exact match.
- Counting the column index from the wrong place. The index is relative to the range you typed, not to the worksheet. If your range starts at column C, then C is 1.
- Forgetting absolute references. Copying a formula with a relative range like B2:E100 down one row turns it into B3:E101, which silently shifts the data window.
- Hiding real problems. IFERROR also catches #REF! and #VALUE! errors caused by broken references or text in a numeric column. Those are bugs, not missing data, and a fallback label can mask them. Check what kind of error you are suppressing before you accept the fallback.
- Mismatched data types. A number stored as text will not match a real number, so VLOOKUP returns #N/A even though the value looks present. Use the ISTEXT or ISNUMBER functions to check, or convert with Text to Columns or VALUE.
- Trailing spaces. Values imported from other systems often carry invisible spaces. TRIM the lookup value or the source column if matches mysteriously fail.
Tips
- Use a named range or an Excel Table reference (like Table1[#All]) instead of a fixed range so the formula expands automatically when rows are added.
- If you need to look left, switch to INDEX and MATCH or XLOOKUP. IFERROR works identically around either one.
- For numeric columns, a fallback of 0 keeps SUM and AVERAGE working; a text fallback will make those functions ignore the cell or return an error.
- Keep the fallback short. Long messages make columns wide and break chart labels.
- If you need to distinguish between "not found" and other errors, use IFNA instead of IFERROR. IFNA only catches #N/A, so genuine formula errors still surface.
Troubleshooting
The formula still shows #N/A. IFERROR should catch it, so check that the closing parenthesis of VLOOKUP sits inside the IFERROR parentheses. A misplaced bracket means IFERROR is only wrapping part of the formula.
Every row shows the fallback. The lookup value probably does not match the source data type. Test with a value you can see in the source table, then compare the two cells with the TYPE function or by checking for leading apostrophes.
Results are wrong but not errors. This is usually an approximate match or a shifted range. Confirm the fourth argument is FALSE and that the range is locked with dollar signs.
#NAME? appears. The function name is misspelled, or you are using a version of Excel that does not support the function you typed. IFERROR is supported from Excel 2007 onward.
The fallback text appears in a numeric total. Change the fallback to 0, or wrap the whole formula in IFERROR at the point of calculation instead. Mixing text and numbers in a sum column is a common cause of wrong totals.
If that did not work, rebuild the formula in a fresh cell step by step, testing the VLOOKUP alone before adding IFERROR. Isolating each part shows exactly which argument is wrong.
Frequently Asked Questions
What does IFERROR VLOOKUP actually do?
It runs a VLOOKUP and replaces any error result with a value you choose, usually a blank, a label, or zero. It does not fix the underlying lookup; it only controls what is displayed.
Should I use IFERROR or IFNA with VLOOKUP?
Use IFNA when you only want to hide #N/A (missing lookup values) and still see other errors. Use IFERROR when you want to suppress every error type.
Can I use IFERROR with XLOOKUP instead?
Yes. XLOOKUP has its own if_not_found argument, so you can usually skip IFERROR entirely: =XLOOKUP(A2, B2:B100, D2:D100, "Not found").
Why does my VLOOKUP return #N/A when the value is clearly there?
Almost always a data type mismatch or a trailing space. Numbers stored as text will not match real numbers, and invisible spaces break text matches. TRIM the values or convert the column type.
Does IFERROR slow down a large workbook?
Not noticeably on its own. The bigger performance cost is VLOOKUP over very large ranges; limiting the range to the actual data or using an Excel Table helps more.
Can I nest IFERROR around more than one VLOOKUP?
Yes, but it gets hard to read. For multiple fallback lookups, XLOOKUP or INDEX and MATCH with IFNA is usually cleaner and easier to audit.