Difference between dates and times

Diving_Dan

Board Regular
Joined
Oct 20, 2019
Messages
149
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
 

Some videos you may like

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

GWteB

Well-known Member
Joined
Sep 10, 2010
Messages
1,295
Office Version
  1. 2013
Platform
  1. Windows
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,126,957
Messages
5,621,823
Members
415,859
Latest member
Vain

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
Top