TIME/DATE Calculation

SFCChase

Board Regular
Joined
Jun 25, 2013
Messages
113
Office Version
  1. 2016
Platform
  1. Windows
I'm trying to calculate the total time between 2 dates/times and return the value in days, hours, min. Later on I will be calculation a running total of the values returned. I am unable to use =DATED (nothing shows up when I try type it in).

Any help would be appreciated
UNITDIVERT STARTDIVERT ENDDIVERT TIME
MSU1/1/2025 06001/4/2025 12003, 6, 0
MSU1/5/2025 12001/5/2025 15000, 3, 0
MSU1/8/2025 04001/14/2025 21305, 17, 30
TOTAL9, 2, 30

Looking for a formula to fill D2 and D6. I can separate the dates and times if necessary. Eventually I will be looking to get D6 to calculate based off the specific unit label in Column A, but for now I'd be happy if it just added everything together.

Thanks in advance!
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
It should be =DATEDIF

Also are they real dates and times formatted to look as they do? asking because normally times have a : in them.
If they are real dates and times then you should be able to just subtract what looks like column B from column C

In the below E2 is formatted as dd"," hh","mm and E3 as d"," h", "m
Please note that my dates are in dd/mm/yyyy

Book1
ABCD
1UNITDIVERT STARTDIVERT ENDDIVERT TIME
2MSU01/01/2025 06:0004/01/2025 12:0003, 06,00
3MSU01/01/2025 06:0004/01/2025 12:003 , 6, 0
Sheet2
Cell Formulas
RangeFormula
D2:D3D2=C2-B2


Edit: and with total (you didn't carry over the hours in post one)

Book1
BCD
1DIVERT STARTDIVERT ENDDIVERT TIME
201/01/2025 06:0004/01/2025 12:0003, 06, 00
305/01/2025 12:0005/01/2025 15:0000, 03, 00
408/01/2025 04:0014/01/2025 21:3006, 17, 30
5
6Total 10, 02, 30
Sheet2
Cell Formulas
RangeFormula
D2:D4D2=C2-B2
D6D6=SUM(D2:D4)
 
Last edited:
Upvote 0
It should be =DATEDIF

Also are they real dates and times formatted to look as they do? asking because normally times have a : in them.
If they are real dates and times then you should be able to just subtract what looks like column C from column D

In the below E2 is formatted as dd"," hh","mm and E3 as d"," h", "m
Please note that my dates are in dd/mm/yyyy

Book1
ABCD
1UNITDIVERT STARTDIVERT ENDDIVERT TIME
2MSU01/01/2025 06:0004/01/2025 12:0003, 06,00
3MSU01/01/2025 06:0004/01/2025 12:003 , 6, 0
Sheet2
Cell Formulas
RangeFormula
D2:D3D2=C2-B2
That's my mistake on the DATEDIF, evidently I didn't type correctly before moving on the the rest of the post.

What are you putting in E2 and E3? I can't see them in the table you posted (I don't have xl2bb due to security on our network).

The times I'm using are in military 24hr format but i'll try adding the : to see if it'll straighten things out.
 
Upvote 0
Upvote 0
Highlight the cells you want to reformat, press ctrl+1, and then go to "Custom" and enter the following under "Type":

1738029436320.png
 
Upvote 0
Solution

Forum statistics

Threads
1,226,013
Messages
6,188,419
Members
453,473
Latest member
bbugs73

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