G
Guest
Is there a way to get time in a "short time" format from a DateDiff formula?
example:
Start End DIFFERENCE
5:00AM 6:30AM 1:30
example:
Start End DIFFERENCE
5:00AM 6:30AM 1:30
Ofer said:Get the different in minutes, and then devide by 60
datediff("n",StartTime, EndTime)/60
Is there a way to get time in a "short time" format from a DateDiff
formula?
Douglas J Steele said:Since Time is stored as a fraction of a day, you can take advantage of the
fact that there are 1440 minutes in a day and use:
=Format(DateDiff("n", StartTime, EndTime)/1440, "Short Time")
?Format(DateDiff("n", #05:00:00#, #06:30:00#)/1440, "Short Time")
01:30
Of course, this won't work for time differences that are greater than 24
hours.