https://bugs.documentfoundation.org/show_bug.cgi?id=136615

--- Comment #15 from Eike Rathke <er...@redhat.com> ---
(In reply to Nenad Antic from comment #13)
> Please look in cells G11, G13 and G20. Compare to other cells in column 'G'.
> 
> I have noticed that it usually occurs when time is 8:00 or 14:00 in the cell
> with start time.
(9:00 instead of 14:00?) Apart from that it is related to the underlying values
being IEEE 754 double floating point values (2022-07-04 08:00:00 =
44746.3333333333 and 2022-07-04 16:00:00 = 44746.6666666667 and 2022-07-06
09:00:00 = 44748.375), which calculating with does not deliver exact decimal
results, using the HOUR() and MINUTE() functions that both are *defined* to
truncate the value on such calculations (see
https://docs.oasis-open.org/office/OpenDocument/v1.3/os/part4-formula/OpenDocument-v1.3-os-part4-formula.html#MINUTE
) is counter-productive. Instead of

> =IF(HOUR(E11-D11)+(MINUTE(E11-D11)/60)-(F11/60)=0,"",HOUR(E11-D11)+(MINUTE(E11-D11)/60)-(F11/60))

simply use

=IF(AND(ISBLANK(D11),ISBLANK(E11)),"",ROUND((E11-D11)*24,2))

to subtract start from end date+time and express the difference as hours of
duration.

You'll also notice that most of your results will be unexpected because
starting at row 14 date+time in column D and E are of different days and the
result is a duration of 33 hours instead of 9 hours.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to