How to Lookup Values separated by commas ?

navinrb

Board Regular
Joined
Jun 9, 2020
Messages
82
Office Version
  1. 2019
Platform
  1. Windows
  2. Mobile
  3. Web
Suppose i have lookup values in sheet 1as
Apple,orange,banana
Carrot, watermelon
Apricot, grapes

I want to lookup above fruits in following table in sheet 2
Fruits. Qty. . Price
Apple.
Banana.
Orange.
Watermelon.
Grapes
Apricot
Carrot.
 
Last edited:
Like this (for up to 5 items)?

navinrb.xlsm
AB
1Apple1
2Banana1
3Orange1
4Watermelon2
5Grapes3
6Apricot3
7Carrot2
Sheet2


navinrb.xlsm
AB
1Apple,orange,banana3
2Carrot,watermelon4
3Apricot,grapes,orange7
Sheet1
Cell Formulas
RangeFormula
B1:B3B1=SUMPRODUCT(IFERROR(VLOOKUP(TRIM(MID(SUBSTITUTE(","&A1,",",REPT(" ",100)),{1,2,3,4,5}*100,100)),Sheet2!A$1:B$7,2,0),0))
Does this work only for 5 items ? Anyway thank you so much .?
 
Upvote 0

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

Forum statistics

Threads
1,214,599
Messages
6,120,448
Members
448,966
Latest member
DannyC96

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