dashes in vlookup

  • Thread starter Thread starter anthonyn
  • Start date Start date
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
 
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
 
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?)
 

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

Similar Threads


Back
Top