I'm trying to use xlookup function to get the corresponding values, if the certain text is matching. Following is the example, trying to use. If not right function, would you please point to the right one?
Function:
=XLOOKUP("*"&D1&"*",A1:A4,B1:B4,"Not found",2)
Any support in this regard is really appreciated!
Below is the table in excel:
If I understand your case correctly you're trying to search for a case sensitive match of both comma separated strings in column D to match the space separated strings in column A and return the value of column B for the matching row.
For a single line search you could use:
=FILTER(B$1:B$5,MMULT(--ISNUMBER(FIND(" "&TEXTSPLIT(TEXTAFTER(", "&D$1:D$5,", ",{1,2}),", ")&" "," "&A1&" ")),{1;1})=2,"Not found")
For spilling the results for a range you could use:
This formula works if both comma separatedstrings of
D1:D5
have a (case sensitive) match to the space separated strings inA1:A5
.Or another way:
If it could be more than two separated strings, change it to:
and