Vlookup (or alternative) using "contains" condition

jaldhi_s

New Member
Joined
Jul 4, 2005
Messages
11
Hi- I am a excel newbie so please bare with me if this is a basic question. I have a table like this below. My table has hundreds of rows, i am just simplifying here with 5 rows.

If i want to find out which of the boxes contains Apple, how do i do this. So in example below, answer should be Box 1, 3 and 5.

thanks a lot for your help

Box numberContent
1​
Orange, banana, apple
2​
Banana
3​
Apple, Orange
4​
Banana, Orange
5​
Apple
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
You can do it with TEXTJOIN
Book1
AB
1Box numberContent
21Orange, banana, apple
32Banana
43Apple, Orange
54Banana, Orange
65Apple
7
8Box 1, 3, 5
Sheet11
Cell Formulas
RangeFormula
B8B8="Box "&TEXTJOIN(", ",1,IF(ISNUMBER(SEARCH("Apple",B2:B6)),A2:A6,""))
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Cross posted lookup (or alternative) using "contains" condition

While we do allow Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule 13 here along with the explanation: Forum Rules). This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered.
 
Upvote 0
Cross posted lookup (or alternative) using "contains" condition

While we do allow Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule 13 here along with the explanation: Forum Rules). This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered.
Thanks for poinring that out. I didn't know about the rule. Apologies.
 
Upvote 0
What version of excel do you use.
Does post 2 solve your probelm????
 
Upvote 0
Another option if you have the dynamic functions
+Fluff New.xlsm
ABCD
1Box numberContentApple
21Orange, banana, appleBox 1, 3, 5
32Banana
43Apple, Orange
54Banana, Orange
65Apple
Main
Cell Formulas
RangeFormula
D2D2="Box "&TEXTJOIN(", ",1,FILTER(A2:A6,ISNUMBER(SEARCH(D1,B2:B6))))
 
Upvote 0
Thanks Fluff. I don't know what is dynamic formulas and whether I have it or not, but I should be ablw to get to a computer today and try it out.
Will report back once I have tried it.
 
Upvote 0
Thanks Fluff and Jasonb. The formula worked. It saved me a lot of time so genuine thanks. I need to use this forum more..
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,390
Members
448,957
Latest member
Hat4Life

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