How to get the hour and minutes difference between 2 datetimestamp in Excel?

Viewed 98007

Suppose I have 2 timestamp dates:

  1. 2/24/2010 1:05:15 AM
  2. 2/25/2010 4:05:17 AM

Can anyone please advise what function should I use in Excel to get the difference in hours and minutes?

Thanks.

6 Answers

The difference in hours:

=(A2-A1)*24

The difference in minutes:

=(A2-A1)*24*60

The difference in hours and minutes:

=TRUNC((A2-A1)*24)      - the hours portion
=MOD((A2-A1)*24*60,60)  - the minutes portion

Excel is able to handle date and time arithmetic. It does this by holding the dates and times as decimals. If you key in a date and time in a format that Excel recognises it will (helpfully!) hold the data as a date and time data type. The integer bit is days, and the decimal bit is time. You can use a time cell format to display the time bit in hours minutes seconds etc, or you can convert the decimal to hours, minutes and seconds using 60 in a simple formula

The text formula works by displaying the answer in a time format.

For difference greater than one day some of before answers messes up, better putting up this way for days, hours, minutes & seconds:

=INT(B2-A2) & " days, " & HOUR(B2-A2) & " hours, " & MINUTE(B2-A2) & " minutes and " & SECOND(B2-A2) & " seconds"

It will output in format like

1 days, 3 hours, 0 minutes and 2 seconds

enter image description here

Best option is click on format > custom > [h]:mm, it will work.

01-09-2019 18:55 31-08-2019 03:26

OUTPUT -> 39:26

Related