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

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
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
StartStop130150208209501
17:0017:1511010
17:1517:3011010
17:3017:4511010
17:4518:0011010
18:0018:1510000
18:1518:3010000

<tbody>
</tbody>

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,214,787
Messages
6,121,569
Members
449,038
Latest member
Guest1337

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