View Single Post
  #5   Report Post  
Melvin8
 
Posts: n/a
Default

Hi Daniel
I've tried your solution and it works as long as there aren't 3 overlapping
times like this (should be 1h 25min for those 3)

11/24/2004 17:00 11/24/2004 17:40 0:40
11/24/2004 19:00 11/24/2004 20:15 1:15 <
11/24/2004 19:00 11/24/2004 20:15 1:15 <
11/24/2004 19:30 11/24/2004 20:25 0:10 <
11/24/2004 22:30 11/25/2004 2:25 3:55


Thanks for all the help
Regards Stefan

"Daniel.M" wrote in message
...
Hi Stefan,

With Starts (A1:Ax) and Ends (B1:Bx),
in C1, the following Array (Ctrl-Shift-Enter) formula:

=MAX(0,MIN(IF(EndsB1,IF(StartsB1,Starts,B1),B1))-
MAX(IF(Starts<A1,IF(Ends<A1,A1,Ends)),A1))

Copy C1 till Cx
Sum C1:Cx somewhere and format this cell as [h]:mm

Regards,

Daniel M.

"Stefan Stridh" wrote in message
om...
Hi
Thanks for the help but there are some errors for example
11/08/2004 19:00 11/08/2004 22:17 3:17
11/08/2004 19:30 11/08/2004 21:24 0:00
11/08/2004 22:30 11/08/2004 23:50 1:20
11/09/2004 00:00 11/09/2004 00:45 0:45 <-
11/09/2004 00:30 11/09/2004 04:31 4:01 <-
11/09/2004 02:00 11/09/2004 03:20 0:00

The 4th and 5th record should show a total of 4:31 not 4:46

And if 3 records overlap this wont work :(
It will probably take some vb script to solve this.

Regards Stefan


"Héctor Miguel" wrote in message

...
hi, Stefan !

... two columns with date + time like this
Startdate Enddate
11/08/2004 19:00 11/08/2004 22:17
11/08/2004 19:30 11/08/2004 21:24
11/08/2004 22:30 11/08/2004 23:50
11/09/2004 00:00 11/09/2004 00:31
11/09/2004 00:30 11/09/2004 04:31
11/09/2004 02:00 11/09/2004 03:20
11/09/2004 15:00 11/09/2004 15:12
... sum up the difference ... between each row ... will get the total
...

minutes but I'm looking ... effective time.
Some ... records are overlapping ... record 2 fits inside the frame
of the

first record [...]

might this could work?
assuming record entries in range A2:B[n]
[C2] -first record- 'by default'... formula: =b2-a2
[C3] -from second record-... formula is: =(b3max($b$2:b2))*(b3-a3)
drag/copy/down, and you can now sum 'C' column -number format [h]:mm<-

hth,
hector.