VLOOKUP with MID function error

dcarbajal2006

New Member
Joined
Jan 19, 2018
Messages
6
I am currently using VLOOKUP with nested MID function. However my look up value sometimes is a number and sometimes is a character. the function i have works for either numbers or character but i can find a way to make it work for either. This is how i have it set up:

VLOOKUP(MID(A2,13,1),Sheet2!F24:G29,2,FALSE) "This works for characters"
VLOOKUP(VALUE(MID(A2,13,1)),Sheet2!F24:G29,2,FALSE) "This works for numbers"

The value of A2 is a 16-Digit part number consisting of numbers and letters
as such: ABC1EFR472AEG10. This is entered by the user on cell A2

The lookup table is as such

| A | BB-4CS5-R4-B |
| B | BB-4CS5-R6MM-B |
| C | BB-4CS5-S4-B |
| 2 | BB-4CSS5-R4-B |
| 3 | BB-4CS5-R6MM-B |
| 4 | BB-4CS5-S4-B |

Please let me know if there is a way to do this when the look up date is either a number or text.

Thank you,
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
seems to work
of course that the look up character from the mid function needs to be on the table
in this case G (the 13th character) is not on the information you showed
 
Upvote 0
dcarbajal2006, Good afternoon.

Try to use:

=VLOOKUP(IFERROR(VALUE(MID(A2,13,1)),MID(A2,13,1)), Sheet2!$F$24:$G$29,2,FALSE)

Is that what you want?
I hope it helps.
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top