View Single Post
  #4   Report Post  
Arvi Laanemets
 
Posts: n/a
Default

Hi

Another situation is, when the time interval contains midnight, or even
several days, like start time was 14:45 and end time was 14:30 in next day.
When this is the case, either:
1) Use datetime values instead of times, like A2=14.02.2005 14:45,
A3=15.02.2005 14:30
now you can calculate the difference as
=A3-A2
Depending on max interval length, format the cell with formula as "hh:mm" or
"[h]:mm" or "[d] hh:mm"
This works with time intervals of any length, but start time must always be
the earlier one.

2) With ordinary time values in source cells, like in your example,
calculate the difference as:
=A3-A2+(A3<A2)
Format the cell with formula with any valid time format.
This works, when the time intervals are always less than 24 hours. Again,
start time must always be the earlier one.

--
When sending mail, use address arvil<attarkon.ee
Arvi Laanemets


"SheriffCassidy" wrote in message
...
I'm new to functions and formulas - how do I create one to automatically
update a cell so that it shows the difference between two cells that

display
times.

For example, cell A1 contains 2:30pm and A2 contains 2:45pm - I want A3 to
display the difference, regardless of whether it is a negative or

postivie.
In fact, I would prefer that it made no reference to whether it's a

negative
or not.