Search code examples
google-sheetsconditional-formatting

Conditional formatting in Google Sheets is recognizing some cell values that equal 0, not others


I have two columns in my sheet where I would to use conditional formatting. I'd like the cells to

  • be turned green when the value = 0
  • be red when the value != 0.

Here's how I have the conditional formatting set up:

  • Value is equal to 0 --> color green
  • Value is not equal to 0 --> color red

See screenshot 1

The output does not consistently color the cells correctly.

  • Green cells only have 0 value (this is expected)
  • But sometimes red cells have 0 value (this is unexpected)

See screenshot 2

Any tips on how to fix this?

If it helps, the values of cells in these columns are computed from other cells.

  • column X is =W2-AE2
  • column Z is =Y2-(AE2-AF2)

Solution

  • This is due to the precision of the calculation, especially if you work with days and hours in W, AE and AF. So try to round the results.

    ROUND()

    for instance

    =round(___your formula____,6)