Have multiple conditions trigger the same color

ぐ巨炮叔叔 提交于 2019-12-11 14:31:37

问题


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.


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/35829731/have-multiple-conditions-trigger-the-same-color

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!