Search code examples
google-sheetsconditional-formatting

How to negate MATCH or SEARCH in google sheets conditional formatting?


This works:

=MATCH($F1, "searchterm")

and this works:

=SEARCH($F1, "searchterm")

These don't:

=NOT(MATCH($F1, "searchterm"))
=NOT(SEARCH($F1, "searchterm"))

Because MATCH and SEARCH return positional values, not booleans.

What is the suggested method to negate the search, to highlight rows not matching the search condition?


Solution

  • you can use iserr

    =ISERR(search($F1, "searchterm"))
    

    or

    =ISNA(match($F1, "searchterm"))