| View previous topic :: View next topic |
| Author |
Message |
dummydecoy General User

Joined: 06 Oct 2010 Posts: 39
|
Posted: Wed May 09, 2012 10:59 am Post subject: [SOLVED] formula help, convert date based on time input |
|
|
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 |
|
 |
Villeroy Super User


Joined: 04 Oct 2004 Posts: 10065 Location: Germany
|
Posted: Wed May 09, 2012 11:58 am Post subject: |
|
|
Where is the start date? _________________ Rest in peace, oooforum.org
Get help on http://forum.openoffice.org |
|
| Back to top |
|
 |
scsisys OOo Enthusiast

Joined: 17 Dec 2009 Posts: 164
|
Posted: Wed May 09, 2012 1:48 pm Post subject: |
|
|
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 |
|
 |
dummydecoy General User

Joined: 06 Oct 2010 Posts: 39
|
Posted: Wed May 09, 2012 3:13 pm Post subject: |
|
|
| 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  |
|
| Back to top |
|
 |
scsisys OOo Enthusiast

Joined: 17 Dec 2009 Posts: 164
|
Posted: Wed May 09, 2012 4:23 pm Post subject: |
|
|
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 |
|
 |
Villeroy Super User


Joined: 04 Oct 2004 Posts: 10065 Location: Germany
|
Posted: Thu May 10, 2012 12:14 am Post subject: |
|
|
=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 http://forum.openoffice.org |
|
| Back to top |
|
 |
dummydecoy General User

Joined: 06 Oct 2010 Posts: 39
|
Posted: Thu May 10, 2012 7:48 am Post subject: |
|
|
Oh... yes, you are right. My bad. 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.
Cheers everyone! |
|
| Back to top |
|
 |
|