'Excel: Conditional formatting of whole row based on column value does not work

Suppose I have a simple dataset in 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:

ex1

One line where the value is 2 is marked green and one where it is 9 is not marked.

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:

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?



Solution 1:[1]

Change =$B2>3 to =$B1>3 which should work for you.

Your formula start range and apply start range must be same. Otherwise CF will highlight different cells.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1