Cellwise Try it free

Excel guide · 4 min read

VLOOKUP not working: 7 causes and fixes

Quick answerMost broken VLOOKUPs come down to three things: the fourth argument is missing (so Excel does an approximate match and can return the wrong row), the lookup value is a number while the table holds text (or the reverse), or one side has a hidden space. Add FALSE as the last argument, then check both values with ISTEXT and LEN.

Sample data

Every result on this page was calculated from this sheet by the same spreadsheet engine the Cellwise app uses.

ABCDE
1Order IDCustomerAmountLook up
210482Harlow Dental124010482
310475Brightside Cafe385.510475
410491 Pine & Co215010491
510468Northgate Gym76010477
610499Kessler Law3125
710477Odd Fellows Bakery512.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.

=VLOOKUP(E5,A2:C7,3,FALSE)

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.

=VLOOKUP(E2&"",A2:C7,3,FALSE)

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.

=VLOOKUP(--E3,A2:C7,3,FALSE)

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.

=LEN(A4)

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.

=XLOOKUP(E5,A2:A7,B2:B7)

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.

=IFERROR(VLOOKUP(E4,A2:C7,3,FALSE),"Not found")

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

Related guides

Updated