Link to home
Start Free TrialLog in
Avatar of mbart
mbart

asked on

Use EXCEL to calculate time differences

Hopefully someone has done this.  I am looking for the formula to calculate the difference between one date time and another. Converting to days, hours and minutes.  I can do it in VB but need to be able to do it in EXCEL.  Any suggestions?
ASKER CERTIFIED SOLUTION
Avatar of jutaylor
jutaylor

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of meski
meski

Assuming A1 and A2 have dates in them, and A1 > A2

A3 has "=A1-A2

Now apply custom format like this to A3

"days" dd "hours" hh "minutes" mm "seconds" ss
you could do a macro using VBA in excel to do what you want to achieve, I think that would make things easier for you because then you could work it out exactly how you want to.
I also found this website, I hope it helps !

http://www.mathtools.net/Excel/Time_and_Date/
you have to register with that website I just posted, just so you know. The URL for the function to work out the time , date diff is below. I think that was done in VBA.

http://www.barasch.com/excel/daymoyear.htm
Avatar of mbart

ASKER

Thanks for the quick response.  Looks like this will work great.