Have multiple conditions trigger the same color

2019-08-09 03:12发布

I'm using Google Sheets, a beginner to this (just started yesterday) and trying to create a condition where:

if text contains "x, y, or z"

then color red

There must be some way to do it because I've been doing separate conditions for each one and it's taking up time to do it.

2条回答
我命由我不由天
2楼-- · 2019-08-09 03:46

Select the relevant range (I am assuming starts at A1) and clear any existing CF rules from it. Format, Conditional formatting..., Format cells if... Custom formula is and

=regexmatch(A1,"x|y|z")

with red fill and Done.

查看更多
我欲成王,谁敢阻挡
3楼-- · 2019-08-09 03:56

Looks a little bit ugly, but this is the way you can do it:

=OR(INDIRECT( ADDRESS( ROW( ) ; COLUMN( ) ) )= "x";
    INDIRECT( ADDRESS( ROW( ) ; COLUMN( ) ) )= "y";
    INDIRECT( ADDRESS( ROW( ) ; COLUMN( ) ) )= "z")

In my opinion there is no better way to get the current cell as with the long term.

查看更多
登录 后发表回答