简体   繁体   English

Excel中两列之和的条件格式

[英]Conditional Formatting on Sum of Two Columns in Excel

I have two conditional formatting rules.我有两个条件格式规则。 One highlights the minimum value of the column and works correctly (Column B).一个突出显示列的最小值并正常工作(B 列)。 I want to also highlight the adjacent columns within the same row (Columns D and E).我还想突出显示同一行中的相邻列(D 列和 E 列)。 Columns D and E in the same row will always add up to the value in columns B.同一行中的 D 列和 E 列总和等于 B 列中的值。

Essentially, I need equivalent code to be put into the conditional formatting field that resembles this:本质上,我需要将等效代码放入类似于此的条件格式字段中:

=($B$175=($D$175+$E$175)) AND $B$175=MIN($B$175:$B$190)


=SMALL($B$175:$B190,1)

This will incorrectly fill any item in column D that matches the minimum of column B.这将错误地填写 D 列中与 B 列的最小值相匹配的任何项目。
结果 1

=SMALL($D$175:$E$190,COUNTIF($D$175:$E$190,0)+1)<br>

This will incorrectly fill the minimum of column between columns D and E.这将错误地填充列 D 和 E 之间的列的最小值。
结果 2

=$B$175=($D$175+$E$175) or <br>

=SMALL(($D$175:$D$190)+($E$175:$E$190), 1) =小(($D$175:$D$190)+($E$175:$E$190), 1)
This will incorrectly fill all rows of columns D and E.这将错误地填充列 D 和 E 的所有行。
结果 3

=$B$175=MIN(($D$175:$D$190)+($E$175:$E$190), 1)<br>

This will not fill any rows column between columns D and E.这不会填充列 D 和 E 之间的任何行列。
结果 4

I know I'm close, but can't seem to figure it out!我知道我很接近,但似乎无法弄清楚!

You just need to check that the value in B is the SMALL of $B$175:$B$190 .您只需要检查 B 中的值是否为$B$175:$B$190的小值。 You don't need to consider the sum of E and F.您不需要考虑 E 和 F 的总和。

=$B175=SMALL($B$175:$B190,1)

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM