Suppose I have 2 timestamp dates:
Can anyone please advise what function should I use in Excel to get the difference in hours and minutes?
Thanks.
get time() -startDate. gettime())/1000; Log. d("App","difference in hour is"+diff/1000/60/60); Mins = diff/1000/60; Seconds = diff/1000; Using this code I'm getting hours as a correct value.
In a new cell, type in =DATEDIF(A1,B1,”Y”). The “Y” signifies that you'd like the information reported in years. This will give you the number of years between the two dates. To find the number of months or days between two dates, type into a new cell: =DATEDIF(A1,B1,”M”) for months or =DATEDIF(A1,B1,”D”) for days.
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
this is straight simple in excel and no need to do anything except applying the time format to the cell.
two easy steps:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With