Find the difference in days, hours and minutes between two dates and times

Antoan

New Member
Joined
Nov 29, 2021
Messages
26
Office Version
  1. 2016
Platform
  1. Windows
Hello!



I have cyrrently faced the below stated obstacles. In order to check the actual delay in the sheet below accurately, I decided to consolidate both dates and times into one sheet with the formula: =CONCATENATE(TEXT(M10;"mm/dd/yyyy")&" ; "&TEXT(N10;"hh:mm:ss")). Now I would like to find the difference between the earliest start date and the actual start time in days, hours, minutes, however due to the formating i suppose the simple formula =A1-B1 wouldnt work. Moreover, i tried the one that you can see in the sheet below and I also tried this one:=INT(C5-B5)&" days "&TEXT(C5-B5,"h"" hrs ""m"" mins """) but still turned out to be impossible... Could you maybe give any suggestions or point out at something that i have missed in the sheet below because honestly I dont know why it keeps not happening!

Thank you in advance! :)



alle-linjer-samlet-.xlsx
GJOPSVWX
1Earliest startEarliest finish2SAME DAYLatest Start2Latest finishActual finishActual Start2Comparison Earliest/ActualSTART
209/18/2017 ; 07:00:0009/18/2017 ; 08:00:00TRUE09/18/2017 ; 07:00:0009/18/2017 ; 08:00:0001/00/1900 ; 00:00:0001/00/1900 00:00:00#VALUE!
309/23/2017 ; 07:00:0009/23/2017 ; 08:00:00TRUE09/23/2017 ; 07:00:0009/23/2017 ; 08:00:0001/00/1900 ; 00:00:0001/00/1900 00:00:00#VALUE!
409/23/2017 ; 08:00:0009/23/2017 ; 11:00:00TRUE09/23/2017 ; 08:00:0009/23/2017 ; 11:00:0001/00/1900 ; 00:00:0001/00/1900 00:00:00#VALUE!
509/25/2017 ; 08:00:0009/25/2017 ; 15:00:00TRUE08/03/2012 ; 14:12:0008/06/2012 ; 12:12:0009/25/2017 ; 08:18:3309/23/2017 07:48:14#VALUE!
609/23/2017 ; 11:30:0009/23/2017 ; 13:30:00TRUE09/23/2017 ; 11:30:0009/23/2017 ; 13:30:0001/00/1900 ; 00:00:0001/00/1900 00:00:00#VALUE!
709/23/2017 ; 13:30:0009/23/2017 ; 14:30:00TRUE09/23/2017 ; 13:30:0009/23/2017 ; 14:30:0001/00/1900 ; 00:00:0001/00/1900 00:00:00#VALUE!
808/01/2017 ; 07:00:0008/01/2017 ; 15:00:00TRUE08/01/2017 ; 07:00:0008/01/2017 ; 15:00:0001/00/1900 ; 00:00:0001/00/1900 00:00:00#VALUE!
910/09/2017 ; 07:00:0010/09/2017 ; 07:00:00TRUE10/09/2017 ; 07:00:0010/09/2017 ; 07:00:0009/23/2017 ; 14:00:0009/23/2017 07:00:00#VALUE!
1010/09/2017 ; 07:00:0010/09/2017 ; 12:30:00TRUE10/09/2017 ; 07:00:0010/09/2017 ; 12:30:0001/00/1900 ; 00:00:0001/00/1900 00:00:00#VALUE!
1107/07/2017 ; 00:00:0007/07/2017 ; 00:00:00TRUE07/07/2017 ; 00:00:0007/07/2017 ; 00:00:0001/20/2012 ; 14:25:1509/29/2011 07:00:00#VALUE!
1207/07/2017 ; 00:00:0007/07/2017 ; 00:00:00TRUE07/07/2017 ; 00:00:0007/07/2017 ; 00:00:0001/26/2012 ; 11:58:1501/26/2012 08:00:00#VALUE!
1307/07/2017 ; 00:00:0007/07/2017 ; 00:00:00TRUE07/07/2017 ; 00:00:0007/07/2017 ; 00:00:0002/28/2012 ; 07:25:5401/02/2012 14:30:00#VALUE!
1407/07/2017 ; 00:00:0007/07/2017 ; 00:00:00TRUE07/07/2017 ; 00:00:0007/07/2017 ; 00:00:0009/18/2013 ; 10:03:0801/02/2013 08:00:00#VALUE!
1507/07/2017 ; 00:00:0007/07/2017 ; 00:00:00TRUE07/07/2017 ; 00:00:0007/07/2017 ; 00:00:0001/26/2012 ; 11:58:1501/09/2012 07:00:00#VALUE!
Sheet5
Cell Formulas
RangeFormula
O2:O15O2=IF(G2=P2,FALSE,TRUE)
P2:P15P2=CONCATENATE(TEXT(M2,"mm/dd/yyyy")&" ; "&TEXT(N2,"hh:mm:ss"))
V2:V15,S2:S15,J2:J15V2=CONCATENATE(TEXT(T2,"mm/dd/yyyy")&" ; "&TEXT(U2,"hh:mm:ss"))
W2:W15W2=CONCATENATE(TEXT(K2,"mm/dd/yyyy")&" "&TEXT(L2,"hh:mm:ss"))
X2:X15X2=TEXT([@[Earliest start]]-[@[Actual Start2]],"dd:hh:mm:ss")
G2:G15G2=CONCATENATE(TEXT(E2,"mm/dd/yyyy")&" ; "&TEXT(F2,"hh:mm:ss"))
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
If M10 contains a date, and N10 contains a time, then you can use

=M10+N10

to combine the two into a date / time combination.

You can then subtract some other date and time from the result.
 
Upvote 0
Review the example below and then edit your spreadsheet

T202205a.xlsm
BCDEFGH
1Date 1Time 1Date 2Time 2Time DiffTime difference
218-Sep-1707:0018-Sep-1708:0001:00:00
318-Sep-1707:0018-Sep-1720:0013:00:00
418-Sep-1707:0020-Sep-1720:0061:00:00custom format [h]:mm:ss
518-Sep-1707:0020-Sep-1720:002:13:00:00 custom format d:hh:mm:ss
6
1a
Cell Formulas
RangeFormula
F2:F5F2=(D2+E2)-(B2+C2)
 
Upvote 0
If M10 contains a date, and N10 contains a time, then you can use

=M10+N10

to combine the two into a date / time combination.

You can then subtract some other date and time from the result.
Hej!


That's almost exactly what i have in the comparison column: =TEXT([@[Earliest start]]-[@[Actual Start2]],"dd:hh:mm:ss"), tried you version as well but it just says #VALUE! as shown below:
Cell Formulas
RangeFormula
V2:V9,S2:S9V2=CONCATENATE(TEXT(T2,"mm/dd/yyyy")&" ; "&TEXT(U2,"hh:mm:ss"))
W2:W9W2=CONCATENATE(TEXT(K2,"mm/dd/yyyy")&" "&TEXT(L2,"hh:mm:ss"))
X2:X9X2=master[@[Earliest start]]-[@[Actual Start4]]
 
Upvote 0
Review the example below and then edit your spreadsheet

T202205a.xlsm
BCDEFGH
1Date 1Time 1Date 2Time 2Time DiffTime difference
218-Sep-1707:0018-Sep-1708:0001:00:00
318-Sep-1707:0018-Sep-1720:0013:00:00
418-Sep-1707:0020-Sep-1720:0061:00:00custom format [h]:mm:ss
518-Sep-1707:0020-Sep-1720:002:13:00:00 custom format d:hh:mm:ss
6
1a
Cell Formulas
RangeFormula
F2:F5F2=(D2+E2)-(B2+C2)
That worked perfectly!

Thank you so much for your help! :)
 
Upvote 0

Forum statistics

Threads
1,214,978
Messages
6,122,547
Members
449,089
Latest member
davidcom

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