counting staff between times

cybergremlin

New Member
Joined
Dec 11, 2018
Messages
22
Hi all.

Im trying to work out how many staff i have working between two times and also based on the area they work in.

Col A has staff names, Col B has the area they work in, C&D have the start stop time

The times the staff are working between are in col C&D and i wish to break them down by time intervals which are in col F&G then based on the area they work in (col B) and have these in col H to M

So if the employee works 08:00-16:00 and is in area 208 they need to be in J6:J37


ABCDEFGHIJKLM
1NameAreaStartStop*StartStop130150208209501
2Agent120916:0017:00*07:0007:15
3Agent220908:0018:00*07:1507:30
4Agent320808:0016:00*07:3007:45
5Agent420809:0016:00*07:4508:00
6Agent520810:0014:00*08:0008:15
7Agent615012:0014:00*08:1508:30
8Agent715014:0014:10*08:3008:45
9Agent815014:1016:15*08:4509:00
10Agent915016:1516:25*09:0009:15
11Agent1015016:2518:00*09:1509:30
12Agent1113016:3020:00*09:3009:45
13Agent1220810:0014:10*09:4510:00
14Agent1320910:0014:20*10:0010:15
15Agent1450107:0009:00*10:1510:30

<tbody>
</tbody>

thanks
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Try ARRAY formula in H2 and copy across
Code:
=IFNA(INDEX($A$2:$A$15,MATCH($F2,IF($B$2:$B$15=H$1,$C$2:$C$15),0)),"")
 
Upvote 0
this just seems to add the agent name to 1 cell and also doesn't work if the start time doesn't match 1 of the times in column F. for example Agent8
 
Upvote 0
what about (in H2):
=SOMPRODUCT(--($B$2:$B$15=H$1),--($C$2:$C$15<=$F2),--($D$2:$D$15>=$G2))
 
Upvote 0
[TABLE="width: 392"]
<tbody>[TR]
[TD]Start[/TD]
[TD]Stop[/TD]
[TD="align: right"]130[/TD]
[TD="align: right"]150[/TD]
[TD="align: right"]208[/TD]
[TD="align: right"]209[/TD]
[TD="align: right"]501[/TD]
[/TR]
[TR]
[TD="align: right"]17:00[/TD]
[TD="align: right"]17:15[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]0[/TD]
[/TR]
[TR]
[TD="align: right"]17:15[/TD]
[TD="align: right"]17:30[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]0[/TD]
[/TR]
[TR]
[TD="align: right"]17:30[/TD]
[TD="align: right"]17:45[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]0[/TD]
[/TR]
[TR]
[TD="align: right"]17:45[/TD]
[TD="align: right"]18:00[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]0[/TD]
[/TR]
[TR]
[TD="align: right"]18:00[/TD]
[TD="align: right"]18:15[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[/TR]
[TR]
[TD="align: right"]18:15[/TD]
[TD="align: right"]18:30[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[/TR]
</tbody>[/TABLE]

no problem here . .
 
Upvote 0
Hi sorry, it must of been something to do with my formatting, I've changed that and its now working correctly.

thanks for your help
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top