imported text not recognised in vlookup

marleyps

New Member
Joined
Aug 29, 2003
Messages
37
Hello
I have a problem whereby I have to copy data from my work system into excel and then run a vlookup againt the data.
The problem is that the data is not recognised by the vlookup formula in all cases. the data is part numbers, and is a mix of numerical and alpha numerical.
eg

30524
30536
30568
30569
30584
H1003/45
H1101/44/RE
H1172/40/RE

i run the following code against each line
=VLOOKUP(A1,[PERSONAL.XLSB]KANBAN!$A$1:$B$350,2,FALSE)
and the result should be "Kanban" if there is a match to the lookup table. sometimes the code works but in alot of cases is does not recognise the data . If I overtype the part number and there is a match the code works. I have tried the trim command to remove any leading or trailing spaces, to no avail I am at a loss to understand why the data is not recognised. Any help would be appreciated.

Phill
 

steve the fish

Well-known Member
Joined
Oct 20, 2009
Messages
7,817
Office Version
365
Platform
Windows
Is it always the numbers that fail rather then the alphanumerics?
 

Special-K99

Well-known Member
Joined
Nov 7, 2006
Messages
8,328
If this data comes from the web it could contain CHAR(160) which I dont think TRIM() removes.
 

Forum statistics

Threads
1,084,854
Messages
5,380,308
Members
401,662
Latest member
oct2019

Some videos you may like

This Week's Hot Topics

Top