VLOOKUP returns N/A even though I can see the value on the other sheet Formula Help
Lookup value is an order number like 100234, sitting in column A on both sheets. =VLOOKUP(A2,Orders!A:D,3,FALSE) returns N/A for about a third of the rows and works perfectly for the rest. If I copy the value from one sheet and paste it into the other, the formula works. So the values look identical and clearly are not. What am I looking at?
@xlookup_lena · 12mo ago · 3 replies
Almost always one of three things, in this order:
=LEN(A2)on both sides. If one says 6 and the other says 7, that is your answer, andTRIMfixes it.=ISNUMBER(A2)on both. Text 100234 and numeric 100234 are not equal as far as VLOOKUP is concerned even though they look identical on screen.=SUBSTITUTE(A2,CHAR(160),"")first, then TRIM.The fact that copying the value across fixes it points hard at the second or third one, and a third of rows failing suggests part of your data arrived from a different source than the rest.
Reply
Report
@xlookup_lena · 12mo ago
Classic. Fix it at import rather than with a helper column if you can — Power Query lets you set the column type once and it holds on every refresh.
Reply
Report
@pomodoro_pat · 12mo ago
ISNUMBER was FALSE on exactly the rows that failed. Half the file came from a CSV export.
Reply
Report