Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


At 09:12 08/08/2012 -0700, Nobody Noname wrote:
I have a list of measured times in [H]:MM:SS format and I would like to sum them. If I put in a formula:
= B2+B3+B4+B5
it works, but if I try:
=Sum(B2:B5)
I get "00:00:00" as a result.  What am I missing?

I don't know why these should be different, but what you see will depend crucially on cell formatting - in particular of the results cells.

At 13:01 08/08/2012 -0700, Nobody Noname wrote:
The cells are identified as in H:MM format, but the actual measurements are in minutes and seconds (with a few H:MM:SS sprinkled in). It's a bit confusing because what I see in the Cell is "1:18" as in one minute and eighteen seconds, but what I see in the input line is "01:18:00 AM". The hours and minutes makes sense, but what is that "AM" doing there?

That's easy: the Time formats are really not designed to represent time intervals (as you appear to be handling here) but times of day. First, your "1:18" has been interpreted as one hour eighteen minutes, not one minute and eighteen seconds. And it's then being (properly) identified as eight minutes past one in the morning on the first day of the date range (probably 30 December 1899). If you select a time format instead of a date-and-time one, you will not see the date.

If I switch to text format, I get decimal numbers (e.g. 0.0541666666666667 in the "1:18" cell).

Date and time formats are actually stored as days and fraction of days from the time origin. 01:18 (1:18 a.m.) on the first day is 0.054... days from the time origin.

I suppose pursuing why those cells add like time (seconds roll over to minutes at 60, etc.) when they only look like time values, but don't sum() at all should be left for another day.

I think the crucial thing here is the formatting of the cell in which your sum appears. Suppose you add 18:00:00 to 18:00:00. If you format the result cell as Number, you will get the sum of 18 hours and 18 hours, namely 36 hours - which is presumably what you would want. But if you format the result cell as Time, the calculation adds 18 hours to the first time - which, in truth, is 6 p.m. on that first day - which gives noon on the following day. If you suppress the date element, you will see just 12:00:00, which may not be what you wish to see.

I trust this helps.

Brian Barker


--
For unsubscribe instructions e-mail to: users+help@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.