Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9832

Formula that looks for any matching substrings between two cells

$
0
0

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 A1 contains "foo blah blah",
  • and B1 contains "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)>0

Any help would be greatly appreciated.


Viewing all articles
Browse latest Browse all 9832

Latest Images

Trending Articles



Latest Images