Forum Discussion
Zexall
Apr 23, 2020Copper Contributor
Index Match: search for a string and return multiple values
I'm looking to do a lookup, and I assume index match is the rout to go, but I'm not certain. The lookup value will always be a single line, but the column I'm searching for a match on may have multip...
Riny_van_Eekelen
Apr 23, 2020Platinum Contributor
Zexall This one might work for you:
=TEXTJOIN(CHAR(10),TRUE,FILTER(B2:B30,ISNUMBER(SEARCH("*"&D2&"*",A2:A30)),"-"))
Enter it in E2 and copy it down. Make sure to have "Wrap text" activated where this formula resides.
EDIT: Forget about the wild-cards "*". This will work as well:
=TEXTJOIN(CHAR(10),TRUE,FILTER(B2:B30,ISNUMBER(SEARCH(D2,A2:A30)),"-"))
- wumoladApr 23, 2020Iron Contributor
Riny_van_Eekelen How do you resolve this with older Excel version without filter function?
- Riny_van_EekelenApr 23, 2020Platinum Contributor
wumolad Much more complicated in old-Excel. Key would be to do the ISNUMBER/SEARCH part, determine the row numbers that contain the <search value> and then pick-up the <result> from only these rows using the INDEX and COUNT and AGGREGATE functions.
Edit: Realised now you actually don't need the wildcards!
- SergeiBaklanApr 23, 2020Diamond Contributor
It depends on how "old" is the Excel. If TEXTJOIN is supported when array formula
=TEXTJOIN(CHAR(10),TRUE, IF(ISNUMBER(SEARCH(D2,A2:A30)),B2:B30,""))shall work without help of dynamic arrays.
- wumoladApr 23, 2020Iron Contributor