Imagine I have a table like this:
| A | B | C
--------------
1 | 3 | 6 | 5
2 | 5 | 5 | 7
3 | 2 | 3 | 3
I want to:
- Compare the values of the cells with the values of the cells above them
- Color the background of the cell depending on this comparison
So:
- If I compare the value of A2 to A1, 5 > 3, A2 should have a background of red
- If I compare the value of A3 to A2, 2 < 5, A3 should have a background of green
- If I compare the value of B2 to B1, 5 < 6, B2 should have a background of green
- If I compare the value of B3 to B2, 3 < 5, B3 should have a background of green
- If I compare the value of C2 to C1, 7 > 5, C2 should have a background of red
- If I compare the value of C3 to C2, 3 < 7, C3 should have a background of green
Any ideas on how to do such a thing?
Thanks in advance and best regards,
Meibrah
To color the cells, select the range A2:C3 and choose from the home tab of the ribbon:
Conditional Formatting|Highlight Cell Rules|Greater Than…
with the settings shown, then repeat for Less Than… with Green Text.