| View previous topic :: View next topic |
| Author |
Message |
axelrose Newbie

Joined: 19 Nov 2011 Posts: 2
|
Posted: Sat Nov 19, 2011 10:45 pm Post subject: How to Subtract/Find Difference between two TIMES ?? |
|
|
In OpenOffice's CALC is their an easy way to subtract/find the difference between TWO times in TWO different cells?
start time 1145 pm, end time 455 pm
start time 445 pm, end time 955 pm
and also how to do it when having to cross midnight
 _________________ Rofl McLolPants says hello. HIS PANTS ARE LOADED AS IF A TRACTOR TRAILER BUT WITH LOADS OF LOVE A THE CAREPOLICE. |
|
| Back to top |
|
 |
Villeroy Super User


Joined: 04 Oct 2004 Posts: 10065 Location: Germany
|
Posted: Sun Nov 20, 2011 1:30 am Post subject: |
|
|
If the 2 cells are numeric you simply subtract them from each other. This has been explained to you several times in two forums.
If the 2 cells have text, you need to tell the program which digits represent hours, minutes and that pm adds 12 hours. _________________ Rest in peace, oooforum.org
Get help on http://forum.openoffice.org |
|
| Back to top |
|
 |
axelrose Newbie

Joined: 19 Nov 2011 Posts: 2
|
Posted: Wed Dec 14, 2011 6:45 pm Post subject: OK |
|
|
| Villeroy wrote: | If the 2 cells are numeric you simply subtract them from each other. This has been explained to you several times in two forums.
If the 2 cells have text, you need to tell the program which digits represent hours, minutes and that pm adds 12 hours. |
So I get the difference in the 2 times, then multiply by 1440, then divide by 60 for hours, correct??
thanks all.
p.s. I take a lot of medication and forget easily so forgive if I did post same question 2 times, forgive?? _________________ Rofl McLolPants says hello. HIS PANTS ARE LOADED AS IF A TRACTOR TRAILER BUT WITH LOADS OF LOVE A THE CAREPOLICE. |
|
| Back to top |
|
 |
Villeroy Super User


Joined: 04 Oct 2004 Posts: 10065 Location: Germany
|
Posted: Thu Dec 15, 2011 7:07 am Post subject: |
|
|
You simply subtract and apply some time format to the result.
A1: 06:00
B1: 12:00 (both without a specific date)
C1: B1-A1 => 06:00 which is 0.25 in unit days when you remove the time format. 06:00 is the same cell value as 0.25.
If you really want the amount of minutes as an integer number, multiply the 0.25 days by 1440 in order to get the amount of minutes.
Having a time span from 18:00 until next day.
A1: 12:00
B1: 06:00
you need the concrete dates added to the times.
A1: 12/12/2011 12:00
B1: 15/12/2011 06:00
C1: B1-A1 formatted as [HH]:MM => 60:00 (or decimal 2.5 days)
In many cases you may simply assume that B1 refers to the very next day after A1:
A1: 12:00
B1: 06:00
C1: =B1-A1+(A1>B1) formatted as [HH]:MM => 18:00 (or decimal 0.75 days) simply adding 1 day if A1 is greater than B1. The comparison (A1>B1) evaluates to either TRUE (1) or FALSE (0). _________________ Rest in peace, oooforum.org
Get help on http://forum.openoffice.org |
|
| Back to top |
|
 |
|