# Excel - VLOOKUP Not working

Asked By caverchik on 01-May-12 04:22 PM
```Hello,

I have a unique VLOOKUP question that I have not 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 cannot
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,FALSE) and that worked.

Problem is, each formula will not 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 have parsed out
the data.

Help!

--
caverchik```

Mazzaropi replied to caverchik on 01-May-12 05:23 PM
```caverchik;1601371 Wrote:

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)),MODELNAME!\$A\$2:\$D\$2001,3,FALSE))

Tell me it it worked for you.

--
Mazzaropi```
caverchik replied to Mazzaropi on 02-May-12 04:27 PM
```Mazzaropi;1601373 Wrote:

It worked for a majority of the fields. It did not work for some of
them, and there does not seem to be a pattern as to what those were. I will
work at it some more. Thank you!

--
caverchik```
Mazzaropi replied to caverchik on 02-May-12 09:22 PM
```caverchik;1601418 Wrote:

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.

--
Mazzaropi```