OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

How to Subtract/Find Difference between two TIMES ??

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc
View previous topic :: View next topic  
Author Message
axelrose
Newbie
Newbie


Joined: 19 Nov 2011
Posts: 4

PostPosted: Sat Nov 19, 2011 10:45 pm    Post subject: How to Subtract/Find Difference between two TIMES ?? Reply with quote

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
Sad Sad
_________________
Rofl McLolPants says hello. HIS PANTS ARE LOADED AS IF A TRACTOR TRAILER BUT WITH LOADS OF LOVE A THE CAREPOLICE.
Back to top
View user's profile Send private message
Villeroy
Super User
Super User


Joined: 04 Oct 2004
Posts: 10106
Location: Germany

PostPosted: Sun Nov 20, 2011 1:30 am    Post subject: Reply with quote

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 https://forum.openoffice.org
Back to top
View user's profile Send private message
axelrose
Newbie
Newbie


Joined: 19 Nov 2011
Posts: 4

PostPosted: Wed Dec 14, 2011 6:45 pm    Post subject: OK Reply with quote

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
View user's profile Send private message
Villeroy
Super User
Super User


Joined: 04 Oct 2004
Posts: 10106
Location: Germany

PostPosted: Thu Dec 15, 2011 7:07 am    Post subject: Reply with quote

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 https://forum.openoffice.org
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group