Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 2
Default VLOOKUP Not working

Hello,

I have a unique VLOOKUP question that I haven't been able to solve with other googling.

I have a list that I need to lookup the relevant model names for. The list is both numeric, and alphanumeric. I converted to text, and then sorted so that, for example, 12B1 appeared after 1200, however, I can't get the VLOOKUP to lookup the 12B1 correctly.

To further complicate matters, I want it to only look up by the first four digits in the list.

If I use the formula: =VLOOKUP(--LEFT(A302,4),ModelName!A$2:D$2001,3,FALSE), it will look up the numerics just fine, but not the alphanumerics.

I created a second column to convert the 5 digits to 4, and then did a VLOOKUP on that one for the alphanumeric using this formula: =VLOOKUP(TEXT(B306,"@"),ModelName!A$2:D$2001,3,FAL SE) and that worked.

Problem is, each formula won't work on the opposite data type.

So, I have a few options. If I can get both of the formulas to only look up using the first four digits, that would be great. If I have to, I can convert the whole column to 4 digits, and do a VLOOKUP on that, but if possible I'd like one formula that I can use on the whole spreadsheet rather than having to apply two different formulas after I've parsed out the data.

Help!
  #2   Report Post  
Senior Member
 
Location: Belo Horizonte, Brazil
Posts: 170
Thumbs up

Quote:
Originally Posted by caverchik View Post
Hello,
I have a unique VLOOKUP question that I haven't been able to solve with other googling.
I have a list that I need to lookup the relevant model names for. The list is both numeric, and alphanumeric. I converted to text, and then sorted so that, for example, 12B1 appeared after 1200, however, I can't get the VLOOKUP to lookup the 12B1 correctly.
To further complicate matters, I want it to only look up by the first four digits in the list.
If I use the formula: =VLOOKUP(--LEFT(A302,4),ModelName!A$2:D$2001,3,FALSE), it will look up the numerics just fine, but not the alphanumerics.
I created a second column to convert the 5 digits to 4, and then did a VLOOKUP on that one for the alphanumeric using this formula: =VLOOKUP(TEXT(B306,"@"),ModelName!A$2:D$2001,3,FAL SE) and that worked.
Problem is, each formula won't work on the opposite data type.
So, I have a few options. If I can get both of the formulas to only look up using the first four digits, that would be great. If I have to, I can convert the whole column to 4 digits, and do a VLOOKUP on that, but if possible I'd like one formula that I can use on the whole spreadsheet rather than having to apply two different formulas after I've parsed out the data.
Help!
HELP from BRAZIL <<<<<

Dear caverchik, Good Afternoon.

I believe that you can manage the two situations on the same formula without transform the formula into a nightmare.

Try this one:
=IF(ISTEXT(A302),VLOOKUP(LEFT(A302,4),ModelName!$A $2:$D$2001,3,FALSE),VLOOKUP(VALUE(LEFT(A302,4)),Mo delName!$A$2:$D$2001,3,FALSE))

Adapt the range or cells to your reality, if necessary.

Tell me it it worked for you.
__________________
I hope it can help you.

Best regards,
Marcilio Lobão
---------------------------
Belo Horizonte, Brazil
  #3   Report Post  
Junior Member
 
Posts: 2
Default

Quote:
Originally Posted by Mazzaropi View Post
HELP from BRAZIL <<<<<

Dear caverchik, Good Afternoon.

I believe that you can manage the two situations on the same formula without transform the formula into a nightmare.

Try this one:
=IF(ISTEXT(A302),VLOOKUP(LEFT(A302,4),ModelName!$A $2:$D$2001,3,FALSE),VLOOKUP(VALUE(LEFT(A302,4)),Mo delName!$A$2:$D$2001,3,FALSE))

Adapt the range or cells to your reality, if necessary.

Tell me it it worked for you.
It worked for a majority of the fields. It did not work for some of them, and there doesn't seem to be a pattern as to what those were. I'll work at it some more. Thank you!
  #4   Report Post  
Senior Member
 
Location: Belo Horizonte, Brazil
Posts: 170
Thumbs up

Quote:
Originally Posted by caverchik View Post
It worked for a majority of the fields. It did not work for some of them, and there doesn't seem to be a pattern as to what those were. I'll work at it some more. Thank you!
Dear caverchic, Good Evening.

Attach here a sample of your worksheet.

Please, put there values that work and values that don´t work to easier to find a solution.

We can find a solution as a team.
__________________
I hope it can help you.

Best regards,
Marcilio Lobão
---------------------------
Belo Horizonte, Brazil
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
If (Vlookup 0) working, but what if Vlookup cell does not exist Steve Excel Worksheet Functions 18 November 18th 09 07:33 PM
VLOOKUP not working in VBA DogLover Excel Programming 3 October 31st 09 12:00 PM
VLookup not working Scott Excel Worksheet Functions 2 January 29th 08 03:13 PM
VLOOKUP not working??? Gary Excel Worksheet Functions 7 March 1st 07 11:34 PM
Vlookup not working SMRE Excel Worksheet Functions 1 September 29th 06 04:50 PM


All times are GMT +1. The time now is 03:46 PM.

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

About Us

"It's about Microsoft Excel"