Confident CellsExcel practice Start free

VLOOKUP not working: 6 common problems and how to fix them

Updated 26 November 2026 · 5 min read

When VLOOKUP goes wrong, it either shows #N/A or, worse, brings back a wrong answer with no error at all. Start with the end of the formula: it should finish ,FALSE). Then check for a hidden space, a number stored as text, the column number and the $ signs. The six causes and their fixes are below; they're the same in every version of Excel, on Windows and Mac. If you're new to VLOOKUP, start with VLOOKUP: a simple worked example.

The checklist at a glance

What you seeLikely causeFix
A wrong answer, no error1. FALSE is missingEnd with ,FALSE)
#N/A, but the value is in the table2. A space you can't seeVLOOKUP(TRIM(A2),…)
#N/A on ID numbers3. A number stored as textVALUE(A2), or A2&"" if the table holds text
The wrong column's values4. The column number is out, often after inserting a columnRecount, or use MATCH for the number
#N/A whatever you look up5. The answer's column is left of the search columnXLOOKUP, or INDEX and MATCH
Right at the top, #N/A further down6. The table isn't locked$E$2:$F$9, with F4 (Cmd+T on a Mac)

Each is worked through below on a small sheet, with the broken formula next to the fixed one.

1. A wrong answer, and no error: FALSE is missing

=VLOOKUP(A2,$E$2:$F$6,2) has no fourth part, so Excel uses approximate match. It looks for the biggest value that isn't more than the one you asked for. Here staff ID 1007 was typed by mistake for 1004. There is no 1007, so the right answer is #N/A, but approximate match settles for 1005, the biggest ID under 1007, and brings back Sam Turner with no warning.

ABCDEF
1Staff IDNo FALSEWith FALSEIDName
21003Mia PatelMia Patel1001Ruth Okafor
31007Sam Turner#N/A1002Dan Webb
41003Mia Patel
51004Owen Price
61005Sam Turner
B2 holds =VLOOKUP(A2,$E$2:$F$6,2) and C2 holds =VLOOKUP(A2,$E$2:$F$6,2,FALSE), both copied down. There is no ID 1007: only the version with FALSE says so.

On a list that isn't sorted, approximate match can bring back a value from a row that has nothing to do with the one you wanted. Nothing looks broken, which makes it the most dangerous mistake.

Fix: add FALSE (or 0) for an exact match: =VLOOKUP(A2,$E$2:$F$6,2,FALSE). Leave it out only for bands, such as grade boundaries or commission rates, with the first column sorted smallest first.

2. #N/A, but the value is there: a space

"P-310 " with a space on the end doesn't match "P-310". Spaces often come in with data copied from a system or an email. LEN counts the characters: P-310 has 5, so a LEN of 6 gives the space away. You can also click the cell, then click at the end of the text in the formula bar: if there's a gap after the last letter, that's it.

ABCDEFG
1CodeCharactersPlainWith TRIMCodePrice
2P-310 6#N/A£4.20P-204£6.50
3P-1525£35.00£35.00P-310£4.20
4P-152£35.00
B2 holds =LEN(A2), C2 holds =VLOOKUP(A2,$F$2:$G$4,2,FALSE) and D2 holds =VLOOKUP(TRIM(A2),$F$2:$G$4,2,FALSE), all copied down.

Fix: tidy the data with TRIM, or tidy it inside the lookup: =VLOOKUP(TRIM(A2),$F$2:$G$4,2,FALSE). If the spaces are in the table's first column instead, TRIM that column in a spare column and look up in the tidy copy.

3. #N/A with ID numbers: a number stored as text

A staff ID of 1042 stored as a number and 1042 stored as text look the same, but to Excel they're different, so they don't match. Text numbers usually sit on the left of the cell, often with a small green triangle in the corner.

ABCDEF
1Staff IDNameIDName
21042#N/A1041Ruth Okafor
31042Dan Webb1042Dan Webb
41043Mia Patel
A2 and A3 hold 1042 as text. B2 holds =VLOOKUP(A2,$E$2:$F$4,2,FALSE) and shows #N/A. B3 turns it into a number with VALUE and finds Dan Webb.

Fix: turn the text into numbers. Select the cells, click the warning sign that appears and choose Convert to Number. Or do it in the formula: VALUE(A2) when the value you're looking for is text, or A2&"" when it's the table that holds text. The #N/A error has a sheet for the second case.

4. The wrong column, often after inserting one

The column number, such as the 3 in =VLOOKUP(A2,$E$2:$H$5,3,FALSE), is just a number. Here someone inserted a Supplier column into the price list, between Product and Price. The table grew to E:H, but the 3 stayed 3, so the formula now brings back the supplier.

ABCDEFGH
1CodeColumn 3MATCH for the numberCodeProductSupplierPrice
2P-310Kestrel£4.20P-204StaplerAshby£6.50
3P-152Ashby£35.00P-310Box filesKestrel£4.20
4P-152WhiteboardAshby£35.00
5P-268Hole punchHarbour£7.75
B2 holds =VLOOKUP(A2,$E$2:$H$5,3,FALSE), which now gives the supplier. C2 holds =VLOOKUP(A2,$E$2:$H$5,MATCH("Price",$E$1:$H$1,0),FALSE), which finds the Price heading wherever it is.

Fix: check the number against the table, counting the table's first column as 1 (not column A of the sheet). To stop it happening, let MATCH find the column from its heading, as in C2, or use XLOOKUP, which takes the column itself. Deleting a column has the opposite effect: if the number ends up bigger than the table, you get #REF!.

5. #N/A because it can't look left

VLOOKUP only looks in the first column of the table and only brings back columns to its right. Here the names are in column E and the IDs you want are in column D, to their left. Starting the table at D means VLOOKUP searches the IDs for a name, and finds nothing.

ABCDE
1NameVLOOKUPXLOOKUPIDName
2Dan Webb#N/A10421041Ruth Okafor
3Mia Patel#N/A10431042Dan Webb
41043Mia Patel
B2 holds =VLOOKUP(A2,$D$2:$E$4,1,FALSE), which searches the IDs for a name. C2 holds =XLOOKUP(A2,$E$2:$E$4,$D$2:$D$4), which searches the names and brings back the ID.

Fix: use XLOOKUP, =XLOOKUP(A2,$E$2:$E$4,$D$2:$D$4), or INDEX with MATCH in older Excel: =INDEX($D$2:$D$4,MATCH(A2,$E$2:$E$4,0)). Or move the column, if that's allowed.

6. It works in the first row, then breaks: the table isn't locked

Without $ signs, copying =VLOOKUP(A2,E2:F5,2,FALSE) down one row makes it look in E3:F6. The first row of the table drops out, then the second, so the codes near the top of the list start giving #N/A.

ABCDEF
1CodeNot lockedLockedCodePrice
2P-152£35.00£35.00P-204£6.50
3P-204#N/A£6.50P-310£4.20
4P-268£7.75£7.75P-152£35.00
5P-310#N/A£4.20P-268£7.75
B2 holds =VLOOKUP(A2,E2:F5,2,FALSE), copied down, so the table slides down with it. C2 holds =VLOOKUP(A2,$E$2:$F$5,2,FALSE), and every row finds its price.

Fix: lock the table with $ signs: click on E2:F5 in the formula and press F4 (on a Mac, Cmd+T or Fn+F4) to make it $E$2:$F$5. See absolute references.

Still not right? Three more checks

Hiding #N/A that's expected

Once the lookup is right, some values may really not be in the list. Then =IFNA(VLOOKUP(A2,$E$2:$F$9,2,FALSE),"Not found") shows a message instead. Don't add IFNA or IFERROR until you've checked the #N/A isn't one of the problems above. There's more in #N/A in Excel.

Try it now

Your turn

Some codes in column A have a space on the end, so a plain VLOOKUP gives #N/A on those rows. In B2, look up the price from the table in F1:G7, using TRIM so the spaces don't matter. Your formula will be copied down to B7.

ABCDEFG
1CodePriceCodePrice
2P-310 P-204£6.50
3P-152P-117£18.00
4P-204 P-310£4.20
5P-268P-152£35.00
6P-117 P-268£7.75
7P-310P-095£2.40

Open this in Try a formula: the same sheet with the answer filled in, to change or share by link.

Part of Excel lookup functions practice: every lesson on the topic, with a project in Excel.

Where it works

All six causes and fixes are the same in every version of Excel on Windows and Mac, and in Excel for the web. XLOOKUP needs Excel for Microsoft 365, or Excel 2021 or later; INDEX and MATCH work everywhere.

Questions

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

The value in the table and the one you're looking for aren't quite the same. Check for a space at the end with =LEN(A2), which counts one more character than you can see. Check whether one is a number and the other text: text numbers sit on the left of the cell. Then check the table starts at the column you search, and that it's locked with $ signs.

Why does VLOOKUP return the wrong value?

Usually FALSE is missing from the end, so VLOOKUP uses approximate match and settles for a nearby row instead of saying the value isn't there. The other causes are a column number that counts to the wrong column, often after someone inserted a column, and a code that's in the table twice, where VLOOKUP always uses the first. Add FALSE, recount the columns from the table's first column, and check for repeats.

Why does my VLOOKUP work for some rows and not others?

If the rows near the top work and lower ones fail, the table wasn't locked, so it slid down as you copied the formula. Add $ signs with F4 (Cmd+T on a Mac). If the failures are scattered, those values have a hidden space or are numbers stored as text, or they really aren't in the table. Also check the table reaches the last row of the list.

Why does VLOOKUP show #REF!?

The column number is bigger than the table is wide. A table of E2:F9 has two columns, so asking for column 3 gives #REF!. Count the columns of the table you selected, starting at its first column as 1, and either change the number or make the table wider. #REF! also appears if the sheet or columns the table was on have been deleted.