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

[SOLVED] formula help, convert date based on time input

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


Joined: 06 Oct 2010
Posts: 39

PostPosted: Wed May 09, 2012 10:59 am    Post subject: [SOLVED] formula help, convert date based on time input Reply with quote

Guys, please help me create this

A1 is where the user will input the start time
A2 is where the user will input the end time
B1 is where the user will input the start DATE

But, I need to deduct 12 hours from the times entered in A1 and A2. So,
C1 has the formula =A1-"12:00"
C2 has =A2-"12:00"
D1 will determine the adjusted date with the formula =A1+B1-0.5

Now I need to have D2 determine the end date, based on the end time in A2 and the D1. Is this possible? If so, what is the formula?


Last edited by dummydecoy on Thu May 10, 2012 7:49 am; edited 1 time in total
Back to top
View user's profile Send private message
Villeroy
Super User
Super User


Joined: 04 Oct 2004
Posts: 10106
Location: Germany

PostPosted: Wed May 09, 2012 11:58 am    Post subject: Reply with quote

Where is the start date?
_________________
Rest in peace, oooforum.org
Get help on https://forum.openoffice.org
Back to top
View user's profile Send private message
scsisys
OOo Advocate
OOo Advocate


Joined: 17 Dec 2009
Posts: 248

PostPosted: Wed May 09, 2012 1:48 pm    Post subject: Reply with quote

dummydecoy....

One way to do this is as follows:

In A1, key in the date and start time.....05-08-12 07:00
In A2, key in the date and end time......05-08-12 11:00
Format A1 & A2 to the time format of your choice.

In B1, key in .....=A1
In B2, key in .....=A2
Format B1 & B2 to the date format of your choice.

In C1, key in......=A1-.5
In C2, key in .....=A2-.5
Format C1 & C2 to the same time format as A1 & A2.

In D1, key in .....=C1
In D2, key in .....=D2
Format D1 & D2 to the same date format as B1 & B2.

scsisys
_________________
OO 3.2.1
Win XP /SP3
Back to top
View user's profile Send private message
dummydecoy
General User
General User


Joined: 06 Oct 2010
Posts: 39

PostPosted: Wed May 09, 2012 3:13 pm    Post subject: Reply with quote

scsisys wrote:
dummydecoy....

One way to do this is as follows:

In A1, key in the date and start time.....05-08-12 07:00
In A2, key in the date and end time......05-08-12 11:00
Format A1 & A2 to the time format of your choice.

In B1, key in .....=A1
In B2, key in .....=A2
Format B1 & B2 to the date format of your choice.

In C1, key in......=A1-.5
In C2, key in .....=A2-.5
Format C1 & C2 to the same time format as A1 & A2.

In D1, key in .....=C1
In D2, key in .....=D2
Format D1 & D2 to the same date format as B1 & B2.

scsisys



Thank you sir, but there seems to be one problem. For example, I put
A1, 5-10-2012 10:30 PM
A2, 5-10-2012 01:19 AM



The end date end up earlier than the start date.
Basically, the purpose of this is to convert the time zone from MNL to EST which is earlier 12 hours. I'm just trying to automate the calculation of the end date (D2). Your approach works almost perfectly except for that particular error I posted Very Happy
Back to top
View user's profile Send private message
scsisys
OOo Advocate
OOo Advocate


Joined: 17 Dec 2009
Posts: 248

PostPosted: Wed May 09, 2012 4:23 pm    Post subject: Reply with quote

dummydecoy....

In your last example, A5 is shown as 10:30 PM (start time ??) on 12-30-1899 and
A6 is shown as 1:19 AM ( end time ?? ) on 12-30-1899. Seems to me that the end
time date would be 12-31-1899 as column A is the non-adjusted data. D6 would
then be 12-30-1899 and 1:19 PM.

scsisys
_________________
OO 3.2.1
Win XP /SP3
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 May 10, 2012 12:14 am    Post subject: Reply with quote

=B1-A1+(B1<A1)
gets the difference between two times within 24 hours.
If B1<A1 (end time later than start time) one day is added to the negative number.
_________________
Rest in peace, oooforum.org
Get help on https://forum.openoffice.org
Back to top
View user's profile Send private message
dummydecoy
General User
General User


Joined: 06 Oct 2010
Posts: 39

PostPosted: Thu May 10, 2012 7:48 am    Post subject: Reply with quote

Oh... yes, you are right. My bad. Very Happy End date should have been 12-31. Thank you! problem solved.

Thank you too Villeroy, the use of < opens up further possibilities I did not know about. Very Happy

Cheers everyone!
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