Excel guide · 4 min read
VLOOKUP not working: 7 causes and fixes
Sample data
Every result on this page was calculated from this sheet by the same spreadsheet engine the Cellwise app uses.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Order ID | Customer | Amount | Look up | |
| 2 | 10482 | Harlow Dental | 1240 | 10482 | |
| 3 | 10475 | Brightside Cafe | 385.5 | 10475 | |
| 4 | 10491 | Pine & Co | 2150 | 10491 | |
| 5 | 10468 | Northgate Gym | 760 | 10477 | |
| 6 | 10499 | Kessler Law | 3125 | ||
| 7 | 10477 | Odd Fellows Bakery | 512.75 |
Cause 1: the last argument is missing
=VLOOKUP(E5,A2:C7,3) has no fourth argument, so Excel uses approximate match. Approximate match assumes the first column is sorted from smallest to largest. When it is not, VLOOKUP can quietly return the amount from a different order with no error at all, which is worse than #N/A because nobody notices.
Always end an ID or name lookup with FALSE (or 0). Then VLOOKUP only returns a row whose ID matches exactly, and gives #N/A when there is none.
Result: 512.75
With FALSE, order 10477 returns its own amount, 512.75.
Cause 2: a number looking for text
Order 10482 in A2 was imported as text (it sits on the left of the cell and may show a small green triangle). E2 holds the real number 10482. To Excel these are different values, so the exact lookup fails with #N/A even though both cells look identical.
Check with =ISTEXT(A2) and =ISTEXT(E2). If one is TRUE and the other FALSE, you have found the problem. The quick fix inside the formula is to turn the number into text by joining it with an empty string.
Result: 1240
E2&"" turns 10482 into the text "10482", which matches A2, so the result is 1240.
Cause 3: text looking for a number
The opposite case: E3 holds "10475" as text (often because the column was formatted as Text, or the value came from a form), while the table holds the number 10475.
Put two minus signs in front of the lookup value. The double negative converts text that looks like a number into a real number. The permanent fix is to convert the whole column: select it, click the warning icon, and choose Convert to Number.
Result: 385.5
--E3 turns "10475" into the number 10475, which matches row 3, so the result is 385.50.
Cause 4: a hidden space
A4 contains "10491 " with a trailing space, a classic leftover from copying out of another system. =LEN(A4) returns 6 for a 5-character ID, which gives it away.
Clean the source column rather than patching every formula: add a helper column with =TRIM(A2), fill it down, copy it, and paste as values over the original. Non-breaking spaces from web pages survive TRIM; replace them with =SUBSTITUTE(A2,CHAR(160),"") or use Find and Replace.
Result: 6
LEN returns 6 for a 5-digit ID, so there is one extra character, here a trailing space.
Causes 5 to 7: column number, lookup column, unlocked range
Column number: the third argument counts columns inside the table you selected, not from column A of the sheet. In A2:C7, Customer is 2 and Amount is 3. If you insert a column into the table later, a hard-coded 3 now points at the wrong column.
Lookup column: VLOOKUP can only search the first column of the table and return something to its right. If the ID sits to the right of the value you want, use XLOOKUP or INDEX with MATCH.
Unlocked range: if you copy =VLOOKUP(E2,A2:C7,3,FALSE) down, the table slides to A3:C8, A4:C9 and so on, and rows near the top drop out. Lock it with dollar signs: $A$2:$C$7.
Result: Odd Fellows Bakery
XLOOKUP finds 10477 and returns the customer, Odd Fellows Bakery. It needs no column number and defaults to exact match.
Only hide #N/A once the lookup is correct
IFERROR is useful for IDs that genuinely might not exist, but wrapping a broken lookup in it just hides the bug. Fix the causes above first, then add a friendly message for real misses.
Result: Not found
Until A4 is trimmed, order 10491 still fails to match, so this shows Not found instead of 2150. That is why you clean the data first.
Common mistakes
Leaving out FALSE
Without it, an unsorted table can return a wrong value with no warning. End every exact lookup with FALSE or 0.
Fixing one formula instead of the data
If IDs were imported as text or with spaces, convert or TRIM the source column once. Patches like &"" get forgotten in the next report.
Counting the column number from column A
Count from the first column of your table_array. For B2:F50, column B is 1.
Forgetting to lock the table
Use $A$2:$C$7 (press F4 after selecting the range) before filling the formula down.
FAQ
Why does VLOOKUP return #N/A when the value is clearly there?
The two values are not exactly equal. Usually one is a number and the other is text, or one has an extra space. Compare them with =A2=E2; if it says FALSE, check ISTEXT and LEN on both.
Why does VLOOKUP return the wrong value?
The fourth argument is missing or TRUE, so Excel uses approximate match on a column that is not sorted. Change it to FALSE.
Is VLOOKUP case-sensitive?
No. VLOOKUP treats "abc" and "ABC" as the same. If you need case-sensitive matching, use XLOOKUP or INDEX/MATCH with EXACT inside.
Should I switch to XLOOKUP?
If everyone using the file has Excel 365 or 2021 and later, yes. XLOOKUP defaults to exact match, can look left, and does not break when columns are inserted. Keep VLOOKUP only for files that must open in older Excel.
Functions used
VLOOKUPVertical lookupXLOOKUPModern lookup in any directionISTEXTIs it text?LENLength of textTRIMRemoves extra spacesIFERRORFallback when a formula errors
Related guides
- #N/A error in Excel: causes and fixes
- VLOOKUP vs XLOOKUP
- How to remove spaces in Excel
- How to use INDEX MATCH in Excel
- Excel formulas cheat sheet: the 25 everyone should know
Updated