# Conditional Formatting, Formula equals <>0



## Queeza (Dec 18, 2022)

Hello
I'm having trouble understanding why the conditional formatting formula =C$7-C$25<>0 is working for some column entries but not others. the conditional formatting is to highlight that the entries of time to project numbers equals the amount of time worked. The finish time is 15:03:30 just so the hours worked = 8.06 but that should not be a factor.
Any help with this would be greatly appreciated.
Thanks
Steve
Timesheet.xlsxBCDEFGHIJKLMNOP2SATSUNMONTUEWEDTHUFRI3START TIME06:3006:3006:3006:3006:3006:3006:304START LUNCH12:3012:3012:3012:0012:3012:0012:305FINISH LUNCH13:0013:0013:0012:3013:0012:3013:006FINISH TIME15:03:3015:0315:0315:0315:0315:0315:037HOURS : MIN WORKED8.068.068.068.068.068.068.068PROJECT NUMBER PCC PCC PCC PCC PCC PCC PCC9A18.067.061.006.006.064.004.0610B21.007.061.001.001.001.0011B31.061.001.001.0012B42.062.0013B514B61516171819202122232425TOTALS8.068.068.068.068.068.068.06Sheet1Cell FormulasRangeFormulaC7,E7,G7,I7,K7,M7,O7C7=ROUND((C4-C3+C6-C5)*24,2)C8C8=IF(ISBLANK($R$1),"",$R$1-6)E8E8=IF(ISBLANK($R$1),"",$R$1-5)G8G8=IF(ISBLANK($R$1),"",$R$1-4)I8I8=IF(ISBLANK($R$1),"",$R$1-3)K8K8=IF(ISBLANK($R$1),"",$R$1-2)M8M8=IF(ISBLANK($R$1),"",$R$1-1)O8O8=IF(ISBLANK($R$1),"",$R$1)C25,O25,M25,K25,I25,G25,E25C25=SUM(C9:C24)


----------



## HongRu (Dec 18, 2022)

try to add round fuction on TOTALS.
C25

```
=ROUND(SUM(C9:C24),2)
```
then copy to O25,M25,K25,I25,G25,E25

or
repalce

```
=C$7-C$25<>0
```
by

```
=C$7<>C$25
```


----------



## HongRu (Dec 18, 2022)

maybe this is why.









						Floating-point arithmetic may give inaccurate result in Excel - Office
					

Discusses that floating-point arithmetic may give inaccurate results in Excel.



					learn.microsoft.com


----------



## Queeza (Jan 3, 2023)

Thanks HongRu the rounding did the trick. With both the Hours: Min Worked and Totals rows ROUNDED the conditional formatting now works.
Thanks again.
Steve


----------

