Difference between dates and times

Diving_Dan

Board Regular
Joined
Oct 20, 2019
Messages
161
I've got an excel sheet where dates and times are put into the sheet via a userform. I am trying to work out the difference in hours and minutes between a date in a cell & time in another cell and the date and time in 2 other cells. I tried the following formula.
Excel Formula:
=TEXT(([@[Date leave]]+[@[Time leave]])-([@[Date arrived]]+[@[Time arrived]]),"HH:MM")
Is it possible to do this or would I need to have the date and time in a single cell rather than split across two different cells?

Any help will be appreciated
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
With a formula like this you only calculate the difference in clock hours (not the actual hours). The difference in days is not taken into account, so an actual difference of 26 hours would result in 02:00. As it is unlikely to travel back in time, I would advise subtracting the Leaves from the Arrives.
 
Upvote 0

Forum statistics

Threads
1,214,915
Messages
6,122,212
Members
449,074
Latest member
cancansova

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