date time forumla

james rockford

Active Member
Joined
May 27, 2004
Messages
250
Hello to all, I need to find a formula that will take two dates and two different time ( time in and time out) and subtract them to give me the time what was the balance used

I.E
Date time in date completed time out time used
5/1/2018 10 AM 5/2/2018 11: PM ????


thanks for the help and have a great day
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
type the values like this...

5/1/2018 10:00
5/2/2018 23:00

i think you can use 12 hour and just put am or pm at the end (use a space before)... just make sure excel autoformats them after you type them in and they will be seen as numbers

excel will recognize they are dates (which are decimal values underlying) and you can do any arithmetic you want
 
Last edited:
Upvote 0
then you can concatenate the text and put it inside the value function which converts text (if posssible like with date text) to numbers.

=VALUE(A1&" "&B1)-VALUE(C1&" "&D1)

A1 is the date (ex. "1/1/2018")
B1 is time (ex. "5:00 PM")
C1 is the date (ex. "1/1/2018")
D1 is time (ex. "2:00 PM")

in this example you would get the decimal value 3/24 or 0.125

7lTpw5i.png
 
Last edited:
Upvote 0
Hi,

If your Date and Time are Real Date and Time values (numeric):


Book1
ABCDEF
1DateTime InDate CompletedTime OutTime Used
25/1/201810:00 AM5/2/201811:00 PM37:00
3
4F2 formatted as [h]:mm
Sheet55
Cell Formulas
RangeFormula
F2=SUM(C2,D2)-SUM(A2,B2)
 
Upvote 0
Format as number

Excel 2010
ABCDE
11-Jan-1811:00 AM1-Jan-182:00 PM3.00
21-Jan-1811:00 AM1-Jan-1811:00 PM12.00
3
3a
Cell Formulas
RangeFormula
E1=((C1+D1)-(A1+B1))*24
E2=((C2+D2)-(A2+B2))*24
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,287
Members
452,631
Latest member
a_potato

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top