Lookup and return multiple text values, approximate match

northw

New Member
Joined
Jun 3, 2021
Messages
9
Office Version
  1. 365
  2. 2007
Platform
  1. Windows
  2. MacOS
Hello,
I've been tinkering with XLOOKUP function to bring up multiple values but I've not had much success. I need to lookup codes (fruit in the example below), which can have multiple values (all in the same column, but different cells), which need to be consolidated to a single cell and comma seperated. And to complicate things, values have other characters before/after. Any help is appreciated.

For example:

FruitImageFruitImages
AppleXyzBerry01AppleImgApple01, ImgApple02,ImgApple03
BerryImgApple01BerryXyzBerry01,XYzBerry02
OrangeImgApple02OrangeAbcOrange001,AxzOrange002
PearImgApple03MangoNNMango01
MangoXYzBerry02
AbcOrange001
AxzOrange002
NNMango01


Thank you!
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
For your copy of XL365, give this formula a try...
Excel Formula:
=LET(g,HSTACK(A2:A6,MAP(A2:A6,LAMBDA(x,TEXTJOIN(", ",,FILTER(B2:B9,ISNUMBER(SEARCH(x,B2:B9))))))),FILTER(g,NOT(ISERROR(TAKE(g,,-1)))))
 
Upvote 0
Solution
I won't even try to understand this formula, but all I can say is that, it works! Thank you!
 
Upvote 0

Forum statistics

Threads
1,224,816
Messages
6,181,138
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