[Solved] Time is added wrong (when sum of times > 24h)
[Solved] Time is added wrong (when sum of times > 24h)
using oo 3.2.1 OOo_3.2.1_Win_x86_install-wJRE_en-US.exe
I can add up hours and minutes with no problem until I get to 24 hours, then the result is wrong, even negative.
I track my clock in/out times. Daily, the hours always are correct. When I sum all 7 days, I get this result:
8:29 + 9:53 + 9:51 + 0 + 0 + 6:01 + 0 = -13:46 (all positive times, sum of negative 13 hours...oh no, I owe my company!?)
It is easy for me to see that the time is exactly 2.0 behind. But in my formula, how will I know to add 2. If I work less days, I will only add 1 for example, more then maybe 3 =)
I drag this formula down many rows. Some rows calculate correctly, others don't. I am confused.
I have been running this same calc spreadsheet since oo 2.x so maybe it is corrupt?
I can add up hours and minutes with no problem until I get to 24 hours, then the result is wrong, even negative.
I track my clock in/out times. Daily, the hours always are correct. When I sum all 7 days, I get this result:
8:29 + 9:53 + 9:51 + 0 + 0 + 6:01 + 0 = -13:46 (all positive times, sum of negative 13 hours...oh no, I owe my company!?)
It is easy for me to see that the time is exactly 2.0 behind. But in my formula, how will I know to add 2. If I work less days, I will only add 1 for example, more then maybe 3 =)
I drag this formula down many rows. Some rows calculate correctly, others don't. I am confused.
I have been running this same calc spreadsheet since oo 2.x so maybe it is corrupt?
Last edited by Hagar Delest on Wed Jul 07, 2010 8:08 am, edited 1 time in total.
Reason: tagged [Solved].
Reason: tagged [Solved].
Re: Time is added wrong (when sum of times > 24h)
Not for me on 3.2.0, at least when I enter each time in one cell, then use SUM().
OpenOffice 4.1.11 on Ubuntu; LibreOffice 6.4 on Linux Mint, LibreOffice 7.6.2.1 on Ubuntu
If your problem has been solved or your question has been answered, please edit the first post in this thread and add [Solved] to the title bar.
Nederlandstalig forum
If your problem has been solved or your question has been answered, please edit the first post in this thread and add [Solved] to the title bar.
Nederlandstalig forum
Re: Time is added wrong (when sum of times > 24h)
I have confirmed spreadsheet on another computer, using 3.2.0, calculated sheet correctly. Back to computer with 3.2.1, cannot sum the times correctly when > 24.
- MrProgrammer
- Moderator
- Posts: 4906
- Joined: Fri Jun 04, 2010 7:57 pm
- Location: Wisconsin, USA
Re: Time is added wrong (when sum of times > 24h)
I suggest that you use Format, Cells, Numbers, Format Code, [HH]:MM because the brackets around HH tell the spreadsheet that hours can be larger than 24. If that does not work, I suggest that you post a small sample so we can see what your data and formatting looks like, after removing any proprietary or confidential information.
If this answered your question please go to your first post use the Edit button and add [Solved] to the start of the title. You can select the green checkmark icon at the same time.
If this answered your question please go to your first post use the Edit button and add [Solved] to the start of the title. You can select the green checkmark icon at the same time.
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.6.3, iMac Intel. The locale for any menus or Calc formulas in my posts is English (USA).
AOO 4.1.7 Build 9800, MacOS 13.6.3, iMac Intel. The locale for any menus or Calc formulas in my posts is English (USA).
Re: Time is added wrong (when sum of times > 24h)
I have [HH]:MM as the format. It is wrong. How do I post a small sample? Do you want a screenshot or my time tracking spreadsheet?
Re: Time is added wrong (when sum of times > 24h)
Best to attach your file if smaller tan 128kb. Otherwise a sample file. See http://user.services.openoffice.org/en/ ... =74&t=8289.
Tom K.
Windows 10 Home version 1803 17134.165
LibreOffice 5.4.7.2
Windows 10 Home version 1803 17134.165
LibreOffice 5.4.7.2
Re: Time is added wrong (when sum of times > 24h)
Here is a sample week. (I hope a second set of eyes will see my error right away!)
- Attachments
-
- Time Error.ods
- (11.6 KiB) Downloaded 364 times
Re: Time is added wrong (when sum of times > 24h)
Close. You have "H:MM" as the format, which displays a clock time, which cannot be negative. Change the cell format, as Mr Programmer suggested, and I think you'll see the problem.I have [HH]:MM as the format.
AOO4/LO5 • Linux • Fedora 23
Re: Time is added wrong (when sum of times > 24h)
I'm really sorry, but it says the format is [HH]:MM. I will delete cell and try again. Post back in a minute.
Re: Time is added wrong (when sum of times > 24h)
The error is not in cell L9 where the sum is calculated, but in cells D11:J11. Copy these cells and do a Paste Special in an empty area keeping the Date &Time but not the Formulas or Format. You will see that the values in columns D, E and F are negative and the value in column I is greater than one. Cells D11:J11 are formatted as H:MM and this hides the error. You will have to rework your IF() formula to properly handle Clock Out times beyond midnight. I think this works
as long as you work less than 24 hours and I'm sure there are other ways to do it.
Code: Select all
=IF(D10<D9;D10-D9+1;D10-D9)
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
Re: Time is added wrong (when sum of times > 24h)
Yupp! That was it. I didn't think to reformat the other (seemingly) positive times as another format. Thank you!
Re: Time is added wrong (when sum of times > 24h)
Oops--my bad. I should've mentioned which cells to look at.
AOO4/LO5 • Linux • Fedora 23
-
- Posts: 1
- Joined: Fri Jul 05, 2019 10:30 am
Re: [Solved] Time is added wrong (when sum of times > 24h)
Hi all,
I have a simmilar problem with LibreOffice, I'm trying to sum the hours that I've spend but the SUM of time is incorrect and I can't seem to fix it. Any help will be really appreciated.
I'm adding my file as attachment.
I have a simmilar problem with LibreOffice, I'm trying to sum the hours that I've spend but the SUM of time is incorrect and I can't seem to fix it. Any help will be really appreciated.
I'm adding my file as attachment.
- Attachments
-
- WorkTimeSheet.xlsx
- (16.95 KiB) Downloaded 99 times
OpenOffice Version: 6.2.4.2 (x64) on Windows 10
Re: [Solved] Time is added wrong (when sum of times > 24h)
Apply number format [HH]:MMgandalf006 wrote:Hi all,
I have a simmilar problem with LibreOffice, I'm trying to sum the hours that I've spend but the SUM of time is incorrect and I can't seem to fix it. Any help will be really appreciated.
I'm adding my file as attachment.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Re: [Solved] Time is added wrong (when sum of times > 24h)
And use the Cell styles instead of the direct (manual) formatting.
And always work in the native, International Standard ODF fileformats.
And always work in the native, International Standard ODF fileformats.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.