Search code examples
google-sheetswildcardconditional-formatting

how to perform formatting in google sheets with text containing wildcard or "or" expression?


i want to perform format cells which contain characters "A" or "B" in google sheets

i have attempted "Text contains"

A,B
A|B
(A|B)
"A"|"B"
"A" or "B"

none of them work

or should i try "custom formula is"?

What should i do?enter image description here


Solution

  • In the format rules choose 'custom formula' and then enter this formula

    =regexmatch($B1;"A|B")
    

    This should color the rows in the range B:C where the cells in column B contain A or B.

    See if that works?