I want to search formula that would search multiple text in cell 1 contain in cell 2 but the position is random, please see the result column that I want. For example,
I expected as the result column.
Here the data in Table Markdown format:
Cell 1 | Cell 2 | Result |
---|---|---|
"Yellow, Black, Red, Green, Purple" | "Black, Red, Green, Orange" | FALSE |
"Yellos, Black, Red, Green, Purple" | "Black, Red, Green" | FALSE |
"Yellow, Red, Green, Purple" | "Yellow, Green, Red, Purple" | TRUE |
"Yellow, Green, Purple" | "Purple, Green, Yellow" | TRUE |
BYROW (Range)
fCol
, sCol
) of each row (r
) of the range (data
) are compared using the function (f
).=LET(data,A2:B5,fCol,1,sCol,2,dl,", ",cl,"""",
f,LAMBDA(x,IFERROR(TEXTJOIN(dl,,SORT(
TEXTSPLIT(SUBSTITUTE(x,cl,""),,dl))),"")),
BYROW(data,LAMBDA(r,
f(INDEX(r,,fCol))=f(INDEX(r,,sCol)))))
MAP
(Two Columns)
fi
, se
(i
, e
)) are compared using the function (f
).=LET(fi,A2:A5,se,B2:B5,dl,", ",cl,"""",
f,LAMBDA(x,IFERROR(TEXTJOIN(dl,,SORT(
TEXTSPLIT(SUBSTITUTE(x,cl,""),,dl))),"")),
MAP(fi,se,LAMBDA(i,e,f(i)=f(e))))
The Function (f
)
SUBSTITUTE
is used to remove the double quotes (cl
) from the string.TEXTSPLIT
is used to return the string split by the delimiter (dl
) in a column.SORT
is used to sort the column ascending.TEXTJOIN
with the delimiter (dl
) is used to return the column in a (delimited) string.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With