Sheet 1 is the input sheet, Sheet 2 is the output sheet which displays the staffing levels as a number, and Sheet 3 is the output sheet which displays the names of those reflected in the numbers on Sheet 2.
Sheet 1:
[TABLE="width: 470"]
<tbody>[TR]
[TD][/TD]
[TD] A[/TD]
[TD] B[/TD]
[TD] C[/TD]
[TD] D[/TD]
[TD] E[/TD]
[TD] F[/TD]
[/TR]
[TR]
[TD] 1[/TD]
[TD]Name[/TD]
[TD]Department[/TD]
[TD] Day[/TD]
[TD] Start time[/TD]
[TD] Finish Time[/TD]
[TD] Total hours[/TD]
[/TR]
[TR]
[TD] 2[/TD]
[TD]Doug[/TD]
[TD]Sales[/TD]
[TD]Monday[/TD]
[TD="align: right"]600[/TD]
[TD="align: right"]1400[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD] 3[/TD]
[TD]Doug[/TD]
[TD]Sales[/TD]
[TD]Tuesday[/TD]
[TD="align: right"]600[/TD]
[TD="align: right"]1400[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD] 4[/TD]
[TD]Doug[/TD]
[TD]Sales[/TD]
[TD]Wednesday[/TD]
[TD="align: right"]600[/TD]
[TD="align: right"]1400[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD] 5[/TD]
[TD]Doug[/TD]
[TD]Sales[/TD]
[TD]Thursday[/TD]
[TD="align: right"]600[/TD]
[TD="align: right"]1400[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD] 6[/TD]
[TD]Doug[/TD]
[TD]Sales[/TD]
[TD]Friday[/TD]
[TD="align: right"]600[/TD]
[TD="align: right"]1400[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD] 7[/TD]
[TD]Doug[/TD]
[TD]Sales[/TD]
[TD]Saturday[/TD]
[TD="align: right"]600[/TD]
[TD="align: right"]1400[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD] 8[/TD]
[TD]Frank[/TD]
[TD]Clerical[/TD]
[TD]Sunday[/TD]
[TD="align: right"]1200[/TD]
[TD="align: right"]2000[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD] 9[/TD]
[TD]Frank[/TD]
[TD]Clerical[/TD]
[TD]Monday[/TD]
[TD="align: right"]1200[/TD]
[TD="align: right"]2000[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]Frank[/TD]
[TD]Clerical[/TD]
[TD]Tuesday[/TD]
[TD="align: right"]1200[/TD]
[TD="align: right"]2000[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD]11[/TD]
[TD]Frank[/TD]
[TD]Clerical[/TD]
[TD]Wednesday[/TD]
[TD="align: right"]1200[/TD]
[TD="align: right"]2000[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD]12[/TD]
[TD]Frank[/TD]
[TD]Clerical[/TD]
[TD]Thursday[/TD]
[TD="align: right"]1200[/TD]
[TD="align: right"]2000[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD]13[/TD]
[TD]Frank[/TD]
[TD]Clerical[/TD]
[TD]Friday[/TD]
[TD="align: right"]1200[/TD]
[TD="align: right"]2000[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD]14[/TD]
[TD]Angela[/TD]
[TD]Shipping[/TD]
[TD]Sunday[/TD]
[TD="align: right"]1500[/TD]
[TD="align: right"]2300[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD]15[/TD]
[TD]Angela[/TD]
[TD]Shipping[/TD]
[TD]Monday[/TD]
[TD="align: right"]1500[/TD]
[TD="align: right"]2300[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD]16[/TD]
[TD]Angela[/TD]
[TD]Shipping[/TD]
[TD]Tuesday[/TD]
[TD="align: right"]1500[/TD]
[TD="align: right"]2300[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD]17[/TD]
[TD]Angela[/TD]
[TD]Shipping[/TD]
[TD]Wednesday[/TD]
[TD="align: right"]1500[/TD]
[TD="align: right"]2300[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD]18[/TD]
[TD]Angela[/TD]
[TD]Shipping[/TD]
[TD]Thursday[/TD]
[TD="align: right"]1500[/TD]
[TD="align: right"]2300[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD]19[/TD]
[TD]Angela[/TD]
[TD]Shipping[/TD]
[TD]Friday[/TD]
[TD="align: right"]1500[/TD]
[TD="align: right"]2300[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD]20[/TD]
[TD]Angela[/TD]
[TD]Shipping[/TD]
[TD]Saturday[/TD]
[TD="align: right"]1500[/TD]
[TD="align: right"]2300[/TD]
[TD="align: right"]8[/TD]
[/TR]
</tbody>[/TABLE]
Sheet 2 and 3:
[TABLE="width: 1349"]
<tbody>[TR]
[TD][/TD]
[TD] [TABLE="width: 1349"]
<tbody>[TR]
[TD][/TD]
[TD] A[/TD]
[TD] B[/TD]
[TD] C[/TD]
[TD] D[/TD]
[TD] E[/TD]
[TD] F[/TD]
[TD] G[/TD]
[TD] H[/TD]
[TD] I[/TD]
[TD] J[/TD]
[TD] K[/TD]
[TD] L[/TD]
[TD] M[/TD]
[TD] N[/TD]
[TD] O[/TD]
[TD] P[/TD]
[TD] Q[/TD]
[TD] R[/TD]
[TD] S[/TD]
[TD] T[/TD]
[TD] U[/TD]
[TD] V[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD] Timestamp[/TD]
[TD] Sales[/TD]
[TD]Shipping[/TD]
[TD] Clerical[/TD]
[TD] Sales[/TD]
[TD]Shipping[/TD]
[TD] Clerical[/TD]
[TD] Sales[/TD]
[TD]Shipping[/TD]
[TD] Clerical[/TD]
[TD] Sales[/TD]
[TD]Shipping[/TD]
[TD] Clerical[/TD]
[TD] Sales[/TD]
[TD]Shipping[/TD]
[TD] Clerical[/TD]
[TD]Sales[/TD]
[TD]Shipping[/TD]
[TD] Clerical[/TD]
[TD] Sales[/TD]
[TD]Shipping[/TD]
[TD] Clerical[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[TD][/TD]
[TD]Sunday[/TD]
[TD] Sunday[/TD]
[TD]Sunday[/TD]
[TD]Monday[/TD]
[TD]Monday[/TD]
[TD]Monday[/TD]
[TD]Tuesday[/TD]
[TD]Tuesday[/TD]
[TD]Tuesday[/TD]
[TD]Wednesday[/TD]
[TD]Wednesday[/TD]
[TD]Wednesday[/TD]
[TD]Thursday[/TD]
[TD]Thursday[/TD]
[TD]Thursday[/TD]
[TD]Friday[/TD]
[TD]Friday[/TD]
[TD]Friday[/TD]
[TD]Saturday[/TD]
[TD]Saturday[/TD]
[TD]Saturday[/TD]
[/TR]
[TR]
[TD="align: right"]3[/TD]
[TD]00:01-1:00[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]4[/TD]
[TD]01:00-2:00[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]5[/TD]
[TD]02:00-3:00[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]6[/TD]
[TD]03:00-4:00[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]7[/TD]
[TD]04:00-5:00[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]8[/TD]
[TD]05:00-6:00[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]9[/TD]
[TD]06:00-7:00[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]10[/TD]
[TD]07:00-8:00[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]11[/TD]
[TD]08:00-9:00[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]12[/TD]
[TD]09:00-10:00[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]13[/TD]
[TD]10:00-11:00[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]14[/TD]
[TD]11:00-12:00[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]15[/TD]
[TD]12:00-13:00[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]16[/TD]
[TD]13:00-14:00[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]17[/TD]
[TD]14:00-15:00[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]18[/TD]
[TD]15:00-16:00[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]19[/TD]
[TD]16:00-17:00[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]20[/TD]
[TD]17:00-18:00[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]21[/TD]
[TD]18:00-19:00[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]22[/TD]
[TD]19:00-20:00[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]23[/TD]
[TD]20:00-21:00[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]24[/TD]
[TD]21:00-22:00[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]25[/TD]
[TD]22:00-23:00[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]26[/TD]
[TD]23:00-23:59[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
We need to break the "total hours" data into hourly "categories" (The categories being "100-200", "200-300" and so on.)!
To do this we use the columns G through AE in Sheet1! Use 1 as column G heading, 2359 as column AE heading and the rest of the columns would have the headings 200, 300 until 2300 from columns H till column AD!
Then in the cells G2 through AD20 (not AE20) use this formula -->
=IF($D2=G$1,1,IF(AND($D2<G$1,$E2>=H$1),1,0))
Since here the original data ends in 20th row, we should paste the formula until that row!
The hourly breakup data is now available!
Then we need to TRANSPOSE this data!
Insert a new Sheet, Sheet4.
Select 20 columns (From A through T) and 31 rows.
Then in cell A1 type
=TRANSPOSE(Sheet1!A1:AE20) and press Ctrl+Shift+Enter --> the way to enter an array formula!
In Sheet2, from cells B3 till V26 paste the formula
=SUMIFS(Sheet4!$B7:$T7,Sheet4!$B$2:$T$2,Sheet2!B$1,Sheet4!$B$3:$T$3,Sheet2!B$2)
Sheet2 would be done!
I'm unsure of the Sheet3! If the count in any of the cells would be more than 1, are we to display ALL the names in the corresponding cell? Or is it mandatory that the cell values won't be more than 1?