Calculate and display elapsed time

JGOpsMgr

New Member
Joined
Oct 11, 2024
Messages
16
Office Version
  1. 365
Platform
  1. Windows
Good morning, I am trying to calculate the amount of time between 2 dates and display it in a format that would show years,months,days,hours, and mins. I would also like to calculate only using network days which I havnt even begun to address. for now, I have used the custom format function and tried yy:mm:dd:hh:mm but it seems inconsistent. Am I doing this the correct way or is there a better option?
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Is this what you need?
TRT.xlsx
ABC
711/22/2024 9:1612/23/2024 8:000:1:22:742:44
Sheet1
Cell Formulas
RangeFormula
C7C7=DATEDIF(A7,B7,"y")&":"&DATEDIF(A7,B7,"ym")&":"&ROUND(B7-DATE(YEAR(B7),MONTH(B7),1),0)&":"&TEXT(B7-A7,"[h]:mm")
 
Upvote 0
Everything looked good during formula eval until I got to hours and then the value error, when i copy it to the rest of the dates I get some value. I tried to download XL2BB but it keeps saying my document is protected even though it is not. So, I am afraid I am unable to send a mini-sheet for review.


11/26/2024 7:19 AM11/26/2024 7:20 AM#VALUE!
 
Upvote 0
When I simply deduct the finish time- the start time and use the formatting mentioned above and the time is substantial it looks right. The only exception is that it appears to be having a problem with the month. perhaps I am using the wrong format code?
11/18/2024 1:16 PM11/18/2024 1:18 PM00:01:00:00:01

5/27/2022 12:00 AM10/11/2024 8:00 AM02:05:17:08:00
 
Upvote 0
Here is the fixed formula
TRT.xlsx
ABC
725.11.2024 9:1625.11.2024 10:000:0:0:0:44
825.11.2024 9:1625.12.2024 10:000:1:0:720:44
925.11.2024 9:1625.12.2025 10:001:1:0:9480:44
Sheet1
Cell Formulas
RangeFormula
C7:C9C7=DATEDIF(A7,B7,"y")&":"&DATEDIF(A7,B7,"ym")&":" &DATEDIF(A7,B7,"md")&":"&TEXT(B7-A7,"[h]:mm")
 
Upvote 0
Ok it calculates now and the years , months,days is what i expected on the below but why is the minutes 20840? Sorry Hours

StartedTime Stamp of last moveYears, Months, Days, Hours, Mins
5/27/2022 12:00 AM10/11/2024 8:00 AM2:4:14:20840:00
 
Upvote 0
If you just want hours, replace "[h]" in the formula with "h".
 
Upvote 0
Solution

Forum statistics

Threads
1,225,626
Messages
6,186,088
Members
453,336
Latest member
Excelnoob223

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