Working With Different Time/Date Formats and Formulas

Gator1130

New Member
Joined
Feb 8, 2017
Messages
9
I am trying to find out the number of minutes that have gone by between two different times. The data given to me is presented like this:
[FONT=&quot]
1st Date and Time (2 cells)

8/11/2018 06:48:36pm

2nd Date and Time (1 Cell)

08/11/18 06:43p

The dates are pretty much irrelevant as they are almost always going to be the same day. How can I format these cells so that I can then find the amount of time elapsed between the two in minutes?[/FONT]
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Assuming your dates/times are all in the same row, the formulas below can be used to get the elapsed time in minutes between them. The columns with headers Text1 and Text2 are your raw data which have to be converted to dates and times. Copy the formulas down to cover all your data.
Excel Workbook
ABCDEFG
1Date1Text1Time1Text2Date2Time2Elapsed Minutes
28/11/201806:48:36pm6:48:36 PM08/11/18 06:43p8/11/20186:43:00 PM5.60
38/10/20188:47am8:47:00 AM8/11/18 06:40:05p8/11/20186:40:05 PM2033.08
Sheet13
 
Upvote 0

Excel 2010
ABCD
211-08-186:48:36 PM5.00TRUE
311-08-18 06:43:36 PM5.00TRUE
411-08-2018 06:43:36p5.00FALSE
511-08-2018 06:43p5.60FALSE
6
6cc
Cell Formulas
RangeFormula
C2=((A2+B2)-B3)*1440
C3=(B2-MOD(B3,1))*1440
C4=(B2-(TIMEVALUE(MID(B4,13,8))+(RIGHT(B4,1)="p")*0.5))*1440
C5=(B2-(TIMEVALUE(MID(B5,13,5))+(RIGHT(B5,1)="p")*0.5))*1440
D2=ISNUMBER(B2)
 
Upvote 0
Assuming your dates/times are all in the same row, the formulas below can be used to get the elapsed time in minutes between them. The columns with headers Text1 and Text2 are your raw data which have to be converted to dates and times. Copy the formulas down to cover all your data.
Sheet13

ABCDEFG
Date1Text1Time1Text2Date2Time2Elapsed Minutes

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:75px;"><col style="width:84px;"><col style="width:81px;"><col style="width:112px;"><col style="width:75px;"><col style="width:80px;"><col style="width:111px;"></colgroup><tbody>
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]1[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]2[/TD]
[TD="align: right"]8/11/2018[/TD]
[TD="align: right"]06:48:36pm[/TD]
[TD="align: right"]6:48:36 PM[/TD]
[TD="align: right"]08/11/18 06:43p[/TD]
[TD="align: right"]8/11/2018[/TD]
[TD="align: right"]6:43:00 PM[/TD]
[TD="align: right"]5.60[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]3[/TD]
[TD="align: right"]8/10/2018[/TD]
[TD="align: right"]8:47am[/TD]
[TD="align: right"]8:47:00 AM[/TD]
[TD="align: right"]8/11/18 06:40:05p[/TD]
[TD="align: right"]8/11/2018[/TD]
[TD="align: right"]6:40:05 PM[/TD]
[TD="align: right"]2033.08[/TD]

</tbody>

Spreadsheet Formulas
CellFormula
C2=IF(ISNUMBER(SEARCH("p",B2)),REPLACE(B2,SEARCH("p",B2),2," PM")+0,REPLACE(B2,SEARCH("a",B2),2," AM")+0)
E2=LEFT(D2,SEARCH(" ",D2)-1)+0
F2=IF(ISNUMBER(SEARCH("p",D2)),MOD(REPLACE(D2,FIND("p",D2),2," PM")+0,1),MOD(REPLACE(D2,FIND("a",D2),2," AM")+0,1))
G2=IF(A2=E2,MOD(ABS(F2-C2),1)*24*60,(ABS(A2-E2)+MOD(ABS(F2-C2),1))*24*60)

<tbody>
</tbody>

<tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4

Thank you! It worked perfectly!
 
Upvote 0

Forum statistics

Threads
1,223,991
Messages
6,175,820
Members
452,672
Latest member
missbanana

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