VLOOKUP can't use value from formula for lookup value?

PatRichard

New Member
Joined
Dec 29, 2018
Messages
29
Office Version
  1. 365
Platform
  1. Windows
I have a product number that I use multiple cells to grab various characters from. So, example is UI1950202TB, and then one cell grabs the 'U', next cell grabs the 'I', etc. I'm trying to then use VLOOKUPs to take the values of those cells and populate others. It seems that for cells where the computed value is a number, it doesn't work. But cells where the computed value is letters, works fine.

If I hard code the numbers in those cells instead of calculating by using MID(), the VLOOKUPs work fine. It's just when I use a formula to determine their value that the numeric ones fail.

Ideas on workarounds?
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
What is the formula that generates U?

What is the VLOOKUP formula which apparently uses this U als look up value?
 
Upvote 0
'U' is grabbed via =MID(Input!D3,1,1)
Then, I use =VLOOKUP(Data!$I$2,Data!A2:Data!B7,2)

The third and fourth characters don't use a VLOOKUP

Next character is a 5, which is grabbed via =MID(Input!D3,5,1) and stored in Data!L2
and the corresponding VLOOKUP is =VLOOKUP(Data!$L$2,Data!A31:Data!B36,2)

I tried putting the MID() call in the VLOOKUP formula, and that didn't work either.
If I change the value of Data!L2 to 5, the VLOOKUP works fine.
 
Upvote 0
Whoops - let me try that again.

'U' is grabbed via =MID(Input!D3,1,1) and is stored in Data!I2
Then, I use =VLOOKUP(Data!$I$2,Data!A2:Data!B7,2) - this works fine

The third and fourth characters don't use a VLOOKUP

Next character is a 5, which is grabbed via =MID(Input!D3,5,1) and stored in Data!L2
and the corresponding VLOOKUP is =VLOOKUP(Data!$L$2,Data!A31:Data!B36,2) - this does NOT work, showing '#N/A'

I tried putting the MID() call in the VLOOKUP formula, and that didn't work either.
If I change the value of Data!L2 to 5, the VLOOKUP works fine.
 
Upvote 0
Federal
Rebuilds FET IN (orange label)
Military
AU manufactured
US manufactured for domestic/Canada

<colgroup><col style="mso-width-source:userset;mso-width-alt:4238;width:89pt" width="119"> <col style="mso-width-source:userset;mso-width-alt:14392;width:304pt" width="405"> <col style="width:48pt" width="64"> <col style="mso-width-source:userset;mso-width-alt:4238;width:89pt" width="119"> </colgroup><tbody>
[TD="class: xl63, width: 119"]E[/TD]
[TD="width: 405"]US manufactured for export (green label)[/TD]
[TD="width: 64"][/TD]
[TD="class: xl63, width: 119"]E[/TD]

[TD="class: xl63"]F[/TD]

[TD="class: xl63"]F[/TD]

[TD="class: xl63"]G[/TD]

[TD="class: xl63"]G[/TD]

[TD="class: xl63"]M[/TD]

[TD="class: xl63"]M[/TD]

[TD="class: xl63"]P[/TD]

[TD="class: xl63"]P[/TD]

[TD="class: xl63"]U[/TD]

[TD="class: xl63"]U[/TD]

</tbody>

That far right column is D. C is a blank column.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

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