Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
anthonyn
 
Posts: n/a
Default dashes in vlookup


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


--
anthonyn
------------------------------------------------------------------------
anthonyn's Profile: http://www.excelforum.com/member.php...o&userid=16753
View this thread: http://www.excelforum.com/showthread...hreadid=319553

  #2   Report Post  
Max
 
Posts: n/a
Default

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

--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----
"anthonyn" wrote in message
...

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


--
anthonyn
------------------------------------------------------------------------
anthonyn's Profile:

http://www.excelforum.com/member.php...o&userid=16753
View this thread: http://www.excelforum.com/showthread...hreadid=319553



  #3   Report Post  
Dave Peterson
 
Posts: n/a
Default

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?)



anthonyn wrote:

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

--
anthonyn
------------------------------------------------------------------------
anthonyn's Profile: http://www.excelforum.com/member.php...o&userid=16753
View this thread: http://www.excelforum.com/showthread...hreadid=319553


--

Dave Peterson
  #4   Report Post  
Max
 
Posts: n/a
Default

You're welcome (from us) !
Glad to hear that you got it working
Thanks for the feedback ..
--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----
"anthonyn" wrote

I think a formatting problem is being caused by me copying
and pasting the lookup data from Acrobat then having excel
generated data in the table array.
I stripped the dashes out of the table array data and then
applied Max's fix to clean up the data from Acrobat and
this seems to have fixed the problem.


Thank you both for you responses, they were of great assistance
Tony



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Vlookup finds a blank, but returns a zero - HELP! flummoxed Excel Discussion (Misc queries) 6 January 18th 05 03:15 PM
carrying a hyper link when using the vlookup function mike Excel Worksheet Functions 1 November 19th 04 03:49 AM
VLOOKUP not working Scott Excel Worksheet Functions 3 November 12th 04 08:06 PM
Using Cell references in VLookUp JonWilson631 Excel Worksheet Functions 1 November 4th 04 02:49 AM
vlookup. Amit Excel Worksheet Functions 2 November 3rd 04 12:34 PM


All times are GMT +1. The time now is 06:56 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"