Advanced Rota Formula-Counting Hours

Danman100

New Member
Joined
Sep 5, 2015
Messages
3
Hi,

I am creating a rota on Excel for work and I am trying to figure out how to set a formula that calculates how many staff are working at each our of the day. The rota displays each colleagues start and finish time but I can not figure out how to count staff hourly ie. how many staff in store from 06:00-07:00, how many staff in store from 07:00-08:00 etc.
Probably wasting my time trying to create this formula as I don't think that one exists.
Can anybody help please

Dan
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

Excel 2012
ABCDEFGHIJKLMNO
2Week Commencing-06-Sep
3
4SundayMondayTuesdayWednesdayThursdayFridaySaturday
506-Sep07-Sep08-Sep09-Sep10-Sep11-Sep12-Sep
6Rokiah18:0016:00
7Holly
8Dan06:3003:15
9Nick
10Lewis
11Eden07:30
12Leigh
13Jake
14Phil
15Janet
16Kate
17Louina
18Lianne
19
206:00-7:002
217:00-8:001
228:00-9:000
239:00-10:000
2410:00-11:000
2511:00-12:000
2612:00-13:000
2713:00-14:000
2814:00-15:000
2915:00-16:000
3016:00-17:000
3117:00-18:000
3218:00-19:000
3319:00-20:000
3420:00-21:000
3521:00-22:000
Sheet1
Cell Formulas
RangeFormula
B5=C2
B20=COUNTIF($B$6:$B$18,">06:00")
B21=COUNTIF($B$6:$B$18,">07:00")
B22=COUNTIF($B$6:$B$18,">08:00")
B23=COUNTIF($B$6:$B$18,">09:00")
B24=COUNTIF($B$6:$B$18,">10:00")
B25=COUNTIF($B$6:$B$18,">11:00")
B26=COUNTIF($B$6:$B$18,">12:00")
B27=COUNTIF($B$6:$B$18,">13:00")
B28=COUNTIF($B$6:$B$18,">14:00")
B29=COUNTIF($B$6:$B$18,">15:00")
B30=COUNTIF($B$6:$B$18,">16:00")
B31=COUNTIF($B$6:$B$18,">17:00")
B32=COUNTIF($B$6:$B$18,">18:00")
B33=COUNTIF($B$6:$B$18,">19:00")
B34=COUNTIF($B$6:$B$18,">20:00")
B35=COUNTIF($B$6:$B$18,">21:00")
D5=B5+1
F5=D5+1
H5=F5+1
J5=H5+1
L5=J5+1
N5=L5+1
 
Upvote 0
Try this,

Split the times in A20:A35 into 2 columns.

In C20 enter

=COUNTIFS(B$6:B$18,"<="&$B20,C$6:C$18,">"&$A20)

Copy down then across to each day under the end times.


Code:
[TABLE="width: 325"]
<tbody>[TR]
[TD="colspan: 2"]Week Commencing-[/TD]
[TD="align: right"]06-Sep[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Sunday[/TD]
[TD][/TD]
[TD]Monday[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"]06-Sep[/TD]
[TD][/TD]
[TD="align: right"]07-Sep[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Rokiah[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]08:00[/TD]
[TD="align: right"]13:30[/TD]
[/TR]
[TR]
[TD]Holly[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Dan[/TD]
[TD="align: right"]06:30[/TD]
[TD="align: right"]18:30[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Nick[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Lewis[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]07:45[/TD]
[TD="align: right"]16:00[/TD]
[/TR]
[TR]
[TD]Eden[/TD]
[TD="align: right"]07:30[/TD]
[TD="align: right"]12:30[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Leigh[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Jake[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Phil[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Janet[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Kate[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Louina[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Lianne[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]06:00[/TD]
[TD="align: right"]07:00[/TD]
[TD="align: right"]1[/TD]
[TD][/TD]
[TD="align: right"]0[/TD]
[/TR]
[TR]
[TD="align: right"]07:00[/TD]
[TD="align: right"]08:00[/TD]
[TD="align: right"]2[/TD]
[TD][/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="align: right"]08:00[/TD]
[TD="align: right"]09:00[/TD]
[TD="align: right"]2[/TD]
[TD][/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="align: right"]09:00[/TD]
[TD="align: right"]10:00[/TD]
[TD="align: right"]2[/TD]
[TD][/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="align: right"]10:00[/TD]
[TD="align: right"]11:00[/TD]
[TD="align: right"]2[/TD]
[TD][/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="align: right"]11:00[/TD]
[TD="align: right"]12:00[/TD]
[TD="align: right"]2[/TD]
[TD][/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="align: right"]12:00[/TD]
[TD="align: right"]13:00[/TD]
[TD="align: right"]2[/TD]
[TD][/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="align: right"]13:00[/TD]
[TD="align: right"]14:00[/TD]
[TD="align: right"]1[/TD]
[TD][/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="align: right"]14:00[/TD]
[TD="align: right"]15:00[/TD]
[TD="align: right"]1[/TD]
[TD][/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]15:00[/TD]
[TD="align: right"]16:00[/TD]
[TD="align: right"]1[/TD]
[TD][/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]16:00[/TD]
[TD="align: right"]17:00[/TD]
[TD="align: right"]1[/TD]
[TD][/TD]
[TD="align: right"]0[/TD]
[/TR]
[TR]
[TD="align: right"]17:00[/TD]
[TD="align: right"]18:00[/TD]
[TD="align: right"]1[/TD]
[TD][/TD]
[TD="align: right"]0[/TD]
[/TR]
[TR]
[TD="align: right"]18:00[/TD]
[TD="align: right"]19:00[/TD]
[TD="align: right"]1[/TD]
[TD][/TD]
[TD="align: right"]0[/TD]
[/TR]
[TR]
[TD="align: right"]19:00[/TD]
[TD="align: right"]20:00[/TD]
[TD="align: right"]0[/TD]
[TD][/TD]
[TD="align: right"]0[/TD]
[/TR]
[TR]
[TD="align: right"]20:00[/TD]
[TD="align: right"]21:00[/TD]
[TD="align: right"]0[/TD]
[TD][/TD]
[TD="align: right"]0[/TD]
[/TR]
[TR]
[TD="align: right"]21:00[/TD]
[TD="align: right"]22:00[/TD]
[TD="align: right"]0[/TD]
[TD][/TD]
[TD="align: right"]0[/TD]
[/TR]
</tbody>[/TABLE]
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

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