Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LibreOffice SUM time period in format HH:MM:SS

I want to obtain the sum of several cells containing a period of time in the format HH:MM:SS. In LibreOffice Calc 4.0.3.3, I've copy-pasted the periods of time in the range G14:G21, and formatted the cells as Time HH:MM:SS. I formatted in the same way the cell G22, and inserted in it the following SUM function:

=SUM(G14:G21)

Instead of the expected result, the function returns me this solution 00:00:00. Could you explain me where am I wrong?

like image 362
Gianluca Avatar asked May 22 '13 20:05

Gianluca


2 Answers

You have the wrong format. HH wraps around every 24 hours. Try using [HH] instead of HH, then you get the total number of hours.

like image 170
hansfbaier Avatar answered Sep 19 '22 17:09

hansfbaier


The problem was on the way the data were inserted. Even if cells were formatted as Date, analysing them more in detail I found the values were preceded by an ' (apostrophe). Thus means LibreOffice were seeing them as text string and not a period of time. Deleting the apostrophe solved the issue.

like image 35
Gianluca Avatar answered Sep 22 '22 17:09

Gianluca