Cell A1 contains a long text string. Cells B1:B6 contain various shorter text strings. Cells C1:C6 contain values.
I want to search the string in cell A1 for partial matches in any of the strings from range B1:B6, and for all such partial matches, return the corresponding value from range C1:C6.
=FILTER(C1:C6,ISNUMBER(SEARCH(A1,B1:B6)))
returns the appropriate value(s) when one or more strings in range B1:B6 matches the string in cell A1 exactly, but returns no value in the case of a partial match. =FILTER(C1:C6,ISNUMBER(SEARCH(A1,"*"&B1:B6&"*")))
yields the same result.
Any tips on where to go from here would be appreciated.
=FILTER(C1:C6,ISNUMBER(SEARCH("*"&B1:B6&"*",A1)))
B1:B6
shorter text strings within CellA1
, so here, the first arg ofSEARCH()
say, find_text (B1:B6
), within_text (A1
). returns the position of the character within the string, if returned then wrap withinISNUMBER()
to returnTRUE
and wrap withFILTER()
to return theC1:C6
based on the include