View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Hutchins Tom Hutchins is offline
external usenet poster
 
Posts: 1,069
Default Staff resource query

Maybe something like...

=SUMPRODUCT(--($B$2:$B$3<=A7),--($C$2:$C$3=A7))

where 6:00 is in A7. Copy down as needed. Please note there is an
inconsistency in the sample output you gave. You don't include Person1 at
8:00, but you do include Person2 at 9:30. To be consistent, you should either
show 2 at 8:00 and 1 and 9:30, or 1 at 8:00 and 0 at 9:30. The formula above
will give 2 at 8:00 and 1 and 9:30. To get 1 at 8:00 and 0 at 9:30, change
the formula to

=SUMPRODUCT(--($B$2:$B$3<=A8),--($C$2:$C$3=A8))

Hope this helps,

Hutch

"MJKelly" wrote:


Hi,

How can I use the following input to populate the "Staff Count" as
shown in the example below.

Start Finish
Person1 06:00 08:00
Person2 07:00 09:30


Time Staff Count
06:00 1
06:10 1
06:20 1
06:30 1
06:40 1
06:50 1
07:00 2
07:10 2
07:20 2
07:30 2
07:40 2
07:50 2
08:00 1
08:10 1
08:20 1
08:30 1
08:40 1
08:50 1
09:00 1
09:10 1
09:20 1
09:30 1

kind regards,
Matt