[英]Conditional Formatting Based on Multiple Rules
I'm trying to create a multi rule custom formula for conditional formatting purposes in Google Sheets.我正在尝试为 Google 表格中的条件格式创建多规则自定义公式。
Here is what I want to achieve -这是我想要实现的目标 -
If Deal Size is Small, the deal length cell should be highlighted a specific color based on the criteria -如果交易规模较小,则交易长度单元格应根据标准以特定颜色突出显示 -
0-35 Green 0-35 绿色
35-40 Yellow 35-40 黄色
40+ Red 40+ 红色
If Deal Size is Large, the deal length cell should be highlighted a specific color based on the criteria -如果交易规模很大,则交易长度单元格应根据标准以特定颜色突出显示 -
0-45 Green 0-45 绿色
45-55 Yellow 45-55黄
55+ Red 55+ 红色
Here is some sample data -这是一些示例数据 -
Date Deal Started![]() |
Date Deal Ended![]() |
Deal Length![]() |
Deal Size![]() |
---|---|---|---|
1/13/2023 ![]() |
1/25/2023 ![]() |
12 ![]() |
Small![]() |
12/8/2022 ![]() |
1/17/2023 ![]() |
40 ![]() |
Large![]() |
11/8/2022 ![]() |
1/9/2023 ![]() |
62 ![]() |
Small![]() |
10/7/2022 ![]() |
1/31/2023 ![]() |
116 ![]() |
Large![]() |
12/12/2022 ![]() |
1/30/2023 ![]() |
49 ![]() |
Large![]() |
I've read some blogs online but haven't found a solution for what I want to achieve.我已经在线阅读了一些博客,但还没有找到我想要实现的解决方案。
0-35 for green and 35-40 for yellow.绿色为 0-35,黄色为 35-40。 So what color if exactly 35?
那么如果恰好是 35 是什么颜色呢?
Use 3 custom formulas for conditional formatting.使用 3 个自定义公式进行条件格式设置。 Move = signs where needed.
在需要的地方移动 = 标志。 Range in example
C2:C7
示例中的范围
C2:C7
Green:绿色的:
=OR(AND(D2="Small",C2>0,C2<35),AND(D2="Large",C2>0,C2<45))
Yellow:黄色的:
=OR(AND(D2="Small",C2>=35,C2<40),AND(D2="Large",C2>=45,C2<55))
Red:红色的:
=OR(AND(D2="Small",C2>=40),AND(D2="Large",C2>=55))
Result:结果:
or you can do it like this too:或者你也可以这样做:
green:绿色的:
=((D2="Small")*(C2>0)*(C2<35))+((D2="Large")*(C2>0)*(C2<45))
yellow:黄色的:
=((D2="Small")*(C2>=35)*(C2<40))+((D2="Large")*(C2>=45)*(C2<55))
red:红色的:
=((D2="Small")*(C2>=40))+((D2="Large")*(C2>=55))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.