Hours and Minutes between two dates and times

Ebusua

New Member
Joined
Aug 17, 2014
Messages
22
Hi,

I am after a formula or VBA, which works out the total hours and minutes between two dates and times:
i.e. A1: 11/11/2014 21:00 A2: 12/11/2014 06:00.

Essentially I need the total hours and minutes between Cells A1 and A2.
Excel has difficulties with 24 hour periods and formulas I have tried place the total hours/minutes worked into a negative value if an end date goes into a 24 hour period.

I hope this makes sense,

Thanks

Ebusua
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Welcome to the board!

Perhaps try something like this?

Excel 2010
AB

<colgroup><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]
[TD="align: center"]11/11/2014 21:00[/TD]
[TD="align: center"]12/11/2014 06:30[/TD]

[TD="align: center"]2[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]3[/TD]
[TD="align: center"]Hours[/TD]
[TD="align: center"]9.5[/TD]

[TD="align: center"]4[/TD]
[TD="align: center"]Minutes[/TD]
[TD="align: center"]570[/TD]

[TD="align: center"]5[/TD]
[TD="align: center"]Combined[/TD]
[TD="align: center"]9 hours 30 minutes[/TD]

</tbody>
Sheet1
[TABLE="width: 85%"]
<tbody>[TR]
[TD]Worksheet Formulas[TABLE="width: 100%"]
<thead>[TR="bgcolor: #DAE7F5"]
[TH="width: 10"]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
</thead><tbody>[TR]
[TH="width: 10, bgcolor: #DAE7F5"]B3[/TH]
[TD="align: left"]=(B1-A1)*(24)[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: #DAE7F5"]B4[/TH]
[TD="align: left"]=(B1-A1)*(24*60)[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: #DAE7F5"]B5[/TH]
[TD="align: left"]=INT((B1-A1)*24)&" hours "&ROUND(MOD((B1-A1)*(24*60),60), 0)&" minutes"[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]

/AJ
 
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

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