Vlookup with singular or multiple lookups

ADSkinner

New Member
Joined
Aug 18, 2018
Messages
19
Good morning....

I have been working on two vlookup formulas to go along with the data as shown.

Column B Column F Column G
1699944 1699942, 1699943, 1699944 40122036
1697497 1697497 40013846

In Column C, row 1 I have formula: =VLOOKUP("*" & B11 & "*",$F$11:$G$12,2,FALSE).

This works and returns the value of Column G by doing the lookup comma separated data in Column F.

However it does not work if Column F is only a singular value, so in Column C, row 2 I have formula: =IF(VLOOKUP(B12,F11:G12,2)=VLOOKUP(B12,F11:G12,2),VLOOKUP(B12,F11:G12,2),VLOOKUP("*"&B12&"*",$F$11:$G$12,2,FALSE)).

This works and returns the value of Column G by doing the lookup, but won't work if I add comma separated data in Column F.

With what I have, am I on the right track in getting it to return the correct value whether it has one, two, three, or many lookup values, by somehow combining these two formulas?

Thanks in advance for taking a look and offering a helping hand.
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Try
=VLOOKUP("*" & B11 & "*",TEXT($F$11:$G$12,"0"),2,FALSE)

This need to be confirmed with Ctrl Shift Enter, not just enter. If done corectly the formula will be wrapped in {}
 
Upvote 0
Hi

Code:
=LOOKUP(9^99,SEARCH(B11,$F$11:$F$12),$G$11:$G$12)
 
Upvote 0

Forum statistics

Threads
1,215,046
Messages
6,122,852
Members
449,096
Latest member
Erald

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