Difference between two times
On 4/29/2018 11:12 AM, GARYWC wrote:
The times are in E16 and G16 so I've changed Claus's formula to:
=TEXT(G16-E16,"h")&" hrs "&TEXT(G16-E16,"m")&" mins" formula.
When I paste that formula in C16, the result is 2 hrs 1 mins.
When I paste that formula into the other cells in column C, the result is 2 hrs 1 mins, regardless of the contents in columns E and G.
That doesn't work because the "m" time specifier isn't smart enough to
parse off the hours and only work on the minutes left after the hours
are occupied.
The following works here; had to use TEXT() for the minutes to avoid
rounding displaying something like 2 hr 11.999999999 min
=INT((H16-F16)*24) &" hr" & " " &
TEXT(MOD((H16-F16)*24,INT((H16-F16)*24))*60,"#") &" min"
It's the typical Excel gibberish since can't have any temporary
variables or the like to write something legible in cell formulae.
--
|