简体   繁体   English

Excel:基于列值的整行条件格式不起作用

[英]Excel: Conditional formatting of whole row based on column value does not work

Suppose I have a simple dataset in Excel:假设我在 Excel 中有一个简单的数据集:

Column 1    Column 2
A           1
B           1
C           2
D           4
E           5
F           9

P1

Now I want to mark the whole row with green color, if the value in column 2 is larger than 3. I apply a conditional format with the formula =$B2>3 applied on range =$A$1:$B$7 and it does not work:现在我想用绿色标记整行,如果第 2 列中的值大于 3。我应用条件格式,公式=$B2>3应用于范围=$A$1:$B$7并且确实如此不行:

前一

One line where the value is 2 is marked green and one where it is 9 is not marked.值为 2 的行标记为绿色,值为 9 的行未标记。

Now I want to mark the row, however only, if the value in column 2 is between 3 and 6. I apply the formula =AND(3<$B2;$B2<6) to the same range and it does not work:现在我想标记该行,但仅当第 2 列中的值介于 3 和 6 之间时。我将公式=AND(3<$B2;$B2<6)应用于相同的范围,但它不起作用:

ex2

Nothing is marked green.没有任何东西被标记为绿色。

Where is my mistake?我的错误在哪里?

Update : I now also tried =AND(3<$B1;$B1<6) , but still nothing is marked green?更新:我现在也尝试了=AND(3<$B1;$B1<6) ,但仍然没有标记为绿色?

Change =$B2>3 to =$B1>3 which should work for you.=$B2>3更改为=$B1>3这应该适合您。

Your formula start range and apply start range must be same.您的公式起始范围和应用起始范围必须相同。 Otherwise CF will highlight different cells.否则 CF 将突出显示不同的单元格。

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

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