In Google Sheets, I'm trying to compose a formula that compares the substrings in two cells.
Substrings in each cell are separated by a space.
The formula should return TRUE if any substring in one cell also matches a substring in the other cell.
I intend to use the formula to conditionally format cells.
For example,
- if
A1contains"foo blah blah", - and
B1contains"foo bar" - then the formula returns TRUE (both contain
"foo") - and conditional formatting is applied to
A1
I tried the following formula but it returns TRUE only if A1="foo" and FALSE if "foo" is a substring:
=IF(FIND(B1,A1),1)>0Any help would be greatly appreciated.









