View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Complicated Time Formula

Norman,

Thank you very much. This was the type of solution I was
hoping for, as I am not very finiliar with VBA. The
formula you suggested functions well, however it results
are placed into the wrong cell. They are off by one hour.
I.E.
A2 Start time 12:15
B2 End Time 12:30

In the 11:00 Column 15 comes up.

Thank you Very Much
-----Original Message-----
Hi Jay!

Here's a formula approach that looks OK:

A2: Start time
B2: Stop time
C1: 8:00
D1: =C1+1/24
Copied across

C2:
=IF(OR(HOUR(D1)<HOUR($A$2),HOUR($B$2)<HOUR

(D1),$B$2=D1),0,IF(HOUR(D1)=
HOUR($A$2),MIN((E1-$A$2),($B$2-$A$2))*24*60,IF(HOUR(D1)

=HOUR($B$2),($B
$2-D1)*24*60,60)))

I've defaulted times outside the range to 0. You may

prefer ""
It seems to test OK but I'm not so sure that there

aren't more
efficient approaches.


--
Regards
Norman Harker MVP (Excel)
Sydney, Australia

Excel and Word Function Lists (Classifications, Syntax

and Arguments)
available free to good homes.
"Jay" wrote in message
...
I have a comlicated formula that I need to develop and
I'm looking for some help. I have two cells that

contain
a start time and an end time. I need to calculate the
total time between the two times and place the value

into
the approipriate time slot. i.e. if the start time is
09:15 and the end time is 11:30 the value in the 09-10
cell would be 45 and the value in the 10-11 cell would

be
60, and the value in the 11-12 cell would be 30. Any
ideas or hints. Thank you.



.