Reputation: 21
Using Google Sheets. I'd like to change a cell's color based on its value relative to another cell in the same row. If the cell to be formatted is empty, I do not want it to change colors; it should remain blank. It would be great if I could apply this logic to a group of cells without having to put in the conditional formatting for each cell individually, but if that's not an option, so be it. The conditional formatting I have so far works except for the part about empty cells remaining blank. Right now, empty cells are being treated like 0 for some reason and turning red. The image below has current conditions out to the right.
The goals are: K7 turns red if the value entered is less than the expected value; K7 turns green if the value entered is greater than or equal to the expected value; K7 has no formatting if K7 is blank.
Upvotes: 0
Views: 430
Reputation: 1
you have two options:
conditional formatting is priority based so the first item on the list has the highest priority. therefore change the order to be like this:
or use COUNTIF()
in your formulas for red and green color:
=COUNTIF(K7, ">="&O7)
=COUNTIF(K7, "<"&O7)
Upvotes: 2
Reputation: 38340
Google Sheets parse empty cells as 0 on formulas that expects a number. If you need to avoid this, use ISBLANK() to check if a cell is empty.
Upvotes: 0