dashes in vlookup

A

anthonyn

I am using vlookup to lookup quantities attached to part numbers. Th
formula works fine unless the part number contains a dash (-) then i
will not find the part number in the table array even though they loo
identical.
I have tried formatting the cells in various ways but it has made n
difference.
Any ideas??
Thanks,
Ton
 
M

Max

Assuming only the lookup values contain the dashes "-"

Instead of say, in B1 : =VLOOKUP(A1,Sheet2!A:B,2,0)

Try something like:

=VLOOKUP(--SUBSTITUTE(TRIM(A1),"-",""),Sheet2!A:B,2,0)

Copy down
 
D

Dave Peterson

I've never had trouble with dashes. Is it possible that you have numeric values
formatted to include dashes either in the table or in the lookup value (with the
opposite being text?)
 
M

Max

You're welcome (from us) !
Glad to hear that you got it working
Thanks for the feedback ..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top