Originally Posted by
joeu2004
Yes. But you do not seem to see what everyone else is saying. The value in H33 only appears to be 37.22 because you format it to show 2 decimal places. The actual value is about 37.2166666666667.
What has not yet been explained yet is: why is H33 about 37.2166666666667 instead of 37.21 = 12 + 3 + 9 + 4 + 3.63 + 5.58, in the first place?
That is more difficult to understand.
As you seem to know, Excel time is stored as a decimal fraction. That is why you multiply the time difference by 24 in H13, for example.
But most decimal fractions cannot be represented exactly in 64-bit binary floating-point, which Excel uses to represent numbers and perform arithmetic.
So the actual values in H13:H18 are:
(I use period for the decimal point and comma to demarcate the first 15 significant digits, which is all that Excel formats.)
Note that 3, 9, 3.63 and 5.58 are not represented exactly.
You might think that 3 and 9 should be, because 3/24 and 9/24 can be represented exactly as 0.125 and 0.375. But the problem is: the decimal representation of 8:00, 10:00, 13:00 and 17:00 cannot be represented exactly.
(FYI, 12 and 4 are exact only by coincidence.)
PS.... The formulas in H13 should be of the form: =IF((F13-D13)>0,ROUND((F13-D13)*24,2),""). Then the sum in H33 will appear to be 37.21, as you might expect.
[EDIT] It would be prudent to also write =IF(ROUND((F13-D13)*24,2)>0,....).
Bookmarks