The code below assumes the Test Start is at location A2 and the Test End
is at B2 and the Time Taken is in C2.
Set BreakStart = Range("E$2:E$9")
Set BreakEnd = Range("F$2:F$9")
Set TotalBreak = Range("G$2:G$9")
ActualTime = C2 - sumproduct(--(BreakStart = A2),--(BreakEnd =<
B2),BotalBreak)
This is the simple case where the break times always fall between the
Start Time and End Time.
The problem gets more complicated if you have the following
Start Time End Time TimeTaken
14:33:49 14:34:12 00:00:23
ActualTime Break Start Break End Total Break
14:34:00 14:35:00 1:00
The above case the break is at the end of the test time and continues
past the end of the test.
--
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread:
http://www.thecodecage.com/forumz/sh...d.php?t=166390
Microsoft Office Help