Bug 105130 - Sum of times not correct
Summary: Sum of times not correct
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.3.3.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-05 19:40 UTC by junge
Modified: 2017-01-10 18:12 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
file that proofs the bug (30.89 KB, application/vnd.oasis.opendocument.spreadsheet)
2017-01-06 17:34 UTC, junge
Details

Note You need to log in before you can comment on or make changes to this bug.
Description junge 2017-01-05 19:40:24 UTC
Description:
Adding times (SUM()) leads to wrong results (especially if blank lines are involved). Example time-value: 08:04:00

Steps to Reproduce:
1. times (like 08:05:00) in cells in one column under each other 
2. put randomly empty cells between them (up to 3 empty cells f.e.)
3. after 10 or more values build the sum of them

Actual Results:  
incorrect sums

Expected Results:
correct sums


Reproducible: Always

User Profile Reset: No

Additional Info:


User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0
Comment 1 Aron Budea 2017-01-05 20:17:08 UTC
Please upload a sample file with an incorrect sum.
Note that cell should be formatted as Time / [HH]:MM:SS, otherwise time is displayed modulo 24h.
Comment 2 junge 2017-01-06 17:34:10 UTC
Created attachment 130216 [details]
file that proofs the bug

Sample file for the time sum bug.
Comment 3 Aron Budea 2017-01-07 14:29:38 UTC
This is exactly caused by what I described, the cell format is not Time / [HH]:MM:SS, adjust it, and you'll see the expected results. Now it shows time as you'd see on a clock, eg. between 0-24h.
Comment 4 junge 2017-01-09 17:14:43 UTC
Actually the in the sum involved cells b2 to b11 are of format time (hh:mm:ss).
Comment 6 junge 2017-01-09 19:49:00 UTC
Tanks for the link. Time format 8766113:37:46 (Format code [HH]:MM:SS) leads to the same result. Is it possible that LibreOffice adds those values as times of the day (times of the clock), but not as times like a sum of hours and minutes?
Comment 7 Aron Budea 2017-01-09 21:25:52 UTC
Are you sure the result field is formatted [HH]:MM:SS? That's what matters.
If I open the attached file, and change B13's format to [HH]:MM:SS, it displays the expected 43:10:00 value.
Comment 8 junge 2017-01-10 17:58:00 UTC
Yes. Finally I got the same result. I summarize: Give all number involved in the sum of times the format hh:mm:ss (cells b2 to b12). The cell with the sum result needs the format [hh]:mm:ss. And voilá the times are added correctly. Thanks a lot.
Comment 9 Aron Budea 2017-01-10 18:12:41 UTC
Note that the summarized times can be formatted any way you want, since it only affects how the time is displayed, and for times between 00:00:00 and 23:59:59 the two formats display the same.