Is there a better way to specify conditional formatting based on another cell? For example, I have specified a Custom formula as the following (which works):

=or($A:$A="bar foo", $A:$A="baz foo")

But I would really prefer to match a partial. Something like (this doesn't work):


1 Answer 1


For partial string matches, use regexmatch, such as

=regexmatch($A:$A, "foo$")

to match any string ending with "foo".

Aside: I find it easier to enter conditional formatting rules as they apply to the single cell in the upper left corner. So my version would be =regexmatch($A1, "foo$"). If the formatting rule is applied, say, to the range C:F, then for E3 the formula would be automatically remapped to =regexmatch($A3, "foo$")

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.