Field Guide

Why is my VLOOKUP returning #N/A?

Updated

#N/A means “not available”: VLOOKUP looked for your value and didn’t find it. Sometimes that’s correct, the value really isn’t there. Far more often the value is there and a small mismatch is hiding it: an approximate match instead of an exact one, a number stored as text, a stray space, or a lookup pointed at the wrong column.

The quickest fix to try first is an exact match. Add FALSE as the fourth argument: =VLOOKUP(D2, A2:C5, 3, FALSE). If that doesn’t do it, work down the short list of usual causes below. Each one has a specific, repeatable fix.

What does #N/A mean in a VLOOKUP?

VLOOKUP searches for your value in the first column of the table you hand it, then returns a value from a column further right. When it can’t find the value in that first column, it returns #N/A.

E2
fx
=VLOOKUP(D2, A2:C5, 3, FALSE)
A B C D E
1 ID Item Price Find ID Price
2 1001 Pencils 2.50 1005 #N/A
3 1002 Pens 3.00
4 1003 Erasers 1.20
5 1004 Markers 4.50
VLOOKUP only searches the shaded first column, A2:A5. The ID 1005 isn't there, so it returns #N/A.

That is the honest case: 1005 genuinely isn’t in the list, so #N/A is the right answer. The confusing case is when the value you’re looking for is plainly sitting in the table and you still get #N/A. That comes down to one of the causes below.

Why is my VLOOKUP returning #N/A when the value is there?

1. You need an exact match (the missing FALSE)

This is the most common surprise. VLOOKUP’s fourth argument, range_lookup, decides how it matches. Leave it out and it defaults to an approximate match, which assumes the first column is sorted in ascending order and returns the closest value at or below what you asked for. On unsorted data that quietly produces #N/A or, worse, the wrong row’s value.

=VLOOKUP(D2, A2:C5, 3, FALSE)
The fourth argument, FALSE, forces an exact match. Leave it out and VLOOKUP assumes the first column is sorted, then guesses.

Microsoft’s guidance is direct: to find an exact match, set range_lookup to FALSE. With FALSE, the order of the table no longer matters and a miss is an honest miss.

2. The lookup value isn’t in the first column

VLOOKUP can only look in the leftmost column of the range you give it. If the value you’re matching on sits in a column to the right of the answer you want, VLOOKUP can’t see it, and you get #N/A.

You can rearrange the columns so the lookup value is on the left. Often the cleaner fix is XLOOKUP, which looks in any column and returns from any other, in either direction:

fx
=XLOOKUP(D2, C2:C5, A2:A5)

That looks for D2 in column C and returns the matching value from column A, to its left, which VLOOKUP can’t do.

3. Numbers stored as text (or text stored as numbers)

A lookup value of the number 1005 will not match a cell containing the text "1005", even though they look identical. This is the sneakiest cause because nothing on screen gives it away. Excel often flags text-numbers with a small green triangle in the top-left corner of the cell.

The fix is to make both sides the same type. Select the text-numbers and use Convert to Number, or reformat the column and re-enter the values, so the lookup value and the table column are both numbers (or both text).

4. Extra spaces or hidden characters

Values pasted in from another system often carry a trailing space ("1005 ") or a non-printing character. To Excel that is a different string, so the match fails. The fix is TRIM, which removes leading and trailing spaces. Microsoft’s own suggestion nests it inside the lookup:

fx
=VLOOKUP(D2, TRIM(A2:B7), 2, FALSE)

Two notes on that formula. The A2:B7 range and the column number 2 are Microsoft’s own two-column example, so swap in your table’s range and column. And in versions of Excel without dynamic arrays, it has to be entered as an array formula, confirmed with Ctrl+Shift+Enter rather than Enter.

Many people find it simpler to clean the lookup column once with TRIM in a helper column, then point VLOOKUP at the cleaned column. Either way, the goal is the same: no stray characters on either side of the match.

How to handle a #N/A you actually expect

Sometimes no match is a perfectly valid outcome: a new product code that isn’t in the price list yet, a name that hasn’t been added. Leaving a raw #N/A in a report looks broken and breaks any sum that touches it. Wrap the lookup so it shows something sensible instead.

The right tool here is usually IFNA, which returns your fallback value only when the formula produces #N/A:

fx
=IFNA(VLOOKUP(D2, A2:C5, 3, FALSE), “Not found”)

IFERROR does a similar job but catches every error type, not just #N/A. That convenience is also its risk: an =IFERROR(VLOOKUP(...), 0) turns a genuinely broken formula, a #REF! from a deleted column, say, into a silent 0 that sails through review and lands in a total. Reach for IFNA when you specifically mean “no match,” and keep IFERROR for when you truly want to swallow anything.

#N/A vs #REF! vs #VALUE!: a VLOOKUP can throw all three

#N/A is only one of the errors VLOOKUP can return, and they mean different things:

If you’re seeing #REF! or #VALUE! rather than #N/A, check the third argument (the column index) before anything else. For the rest of Excel’s error vocabulary, see Excel errors explained.

When to switch to XLOOKUP or INDEX/MATCH

If you keep fighting VLOOKUP, two alternatives sidestep most #N/A traps:

fx
=INDEX(C2:C5, MATCH(D2, A2:A5, 0))

The 0 in MATCH means exact match, the same idea as FALSE in VLOOKUP. Because neither formula counts columns from the left, inserting a column into the middle of your table won’t quietly break them the way it breaks a VLOOKUP with a hard-coded column number.

The full trade-offs, and a worked conversion from one to the other, are in VLOOKUP vs XLOOKUP: which should you use?

The #N/A worth worrying about

A visible #N/A is the harmless kind of error: it’s loud, it’s obvious, and someone fixes it. The dangerous version is a #N/A that’s been “fixed” by wrapping the whole formula in IFERROR(..., 0), which converts a broken lookup into a confident, wrong number that no longer looks like an error at all. Quiet formula mistakes of exactly this kind are what the European Spreadsheet Risks Interest Group (EuSpRiG) has spent years cataloguing in real organisations.

So fix the cause, not just the symptom. And when you change a column of lookups in a model other people depend on, compare the workbook before and after to confirm you fixed the number rather than moving it somewhere you can’t see.

Frequently asked questions

Why does VLOOKUP show #N/A when the value is clearly there?
Almost always one of three things. VLOOKUP is doing an approximate match because the fourth argument is missing, so add FALSE for an exact match. Or the lookup value and the table store the value as different types, a number on one side and text on the other. Or there is a trailing space or hidden character. All three look identical on screen but stop the match.
How do I get rid of a #N/A error in VLOOKUP?
Fix the cause first. Use an exact match with FALSE, confirm the value sits in the first column of the table, match the data types, and trim stray spaces. If a no-match is genuinely expected, wrap the formula in IFNA to show your own text instead, for example =IFNA(VLOOKUP(...), "Not found").
Should I use IFNA or IFERROR with VLOOKUP?
IFNA is usually the safer choice. It replaces only the #N/A value and lets other errors through, so a genuine #REF! or #VALUE! still shows up. IFERROR catches every error type, which is convenient but can hide a real bug behind a friendly value or a zero.
Does VLOOKUP need the data to be sorted?
Only for an approximate match. If the fourth argument, range_lookup, is TRUE or left out, Excel assumes the first column is sorted in ascending order and returns #N/A or a wrong value when it is not. With FALSE, an exact match, the order does not matter.
Why does XLOOKUP work where VLOOKUP returns #N/A?
VLOOKUP can only search the leftmost column of the table and count columns to the right. XLOOKUP looks in any column you point it at and returns from any other, so a lookup whose value sits to the right of the answer, which breaks VLOOKUP, works fine in XLOOKUP.
Why is my VLOOKUP not working at all?
Work through the same short list. A VLOOKUP that shows #N/A can't find the lookup value, usually because it needs an exact match (add FALSE as the fourth argument), the value is in the wrong column, the data types don't match, or there are stray spaces. If it shows #REF! or #VALUE! instead, the column index number is wrong, not the lookup value.

Catch the errors before they ship

Reviewing a change to a model? Compare the two versions in your browser and see every changed cell, formula, and value. It's free, and nothing leaves your computer.