Number of Staff during each 30 minute interval

tinferns

Board Regular
Joined
Aug 18, 2009
Messages
150
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
Hello Team.. another request.. Been thru similar requests threads..none matched my requirement.

Based on the below RAW DATA, I want to know how many staff I have at any given time.

SAMPLE RAW DATA:
[TABLE="width: 786"]
<colgroup><col><col><col><col span="7"></colgroup><tbody>[TR]
[TD]EMP ID[/TD]
[TD]Emp Name[/TD]
[TD]Supervisor[/TD]
[TD]14-Oct-18[/TD]
[TD]15-Oct-18[/TD]
[TD]16-Oct-18[/TD]
[TD]17-Oct-18[/TD]
[TD]18-Oct-18[/TD]
[TD]19-Oct-18[/TD]
[TD]20-Oct-18[/TD]
[/TR]
[TR]
[TD]1070273[/TD]
[TD]Thomas Moses[/TD]
[TD]Martin Fernandes[/TD]
[TD]OFF[/TD]
[TD]OFF[/TD]
[TD]Vacation[/TD]
[TD]20:30[/TD]
[TD]20:30[/TD]
[TD]20:30[/TD]
[TD]20:30[/TD]
[/TR]
[TR]
[TD]1071115[/TD]
[TD]Allan Walker[/TD]
[TD]Ricardo Bravo[/TD]
[TD]OFF[/TD]
[TD]OFF[/TD]
[TD]20:30[/TD]
[TD]20:30[/TD]
[TD]20:30[/TD]
[TD]20:30[/TD]
[TD]20:30[/TD]
[/TR]
[TR]
[TD]1069788[/TD]
[TD]Allison Moyet[/TD]
[TD]Ricardo Bravo[/TD]
[TD]13:30[/TD]
[TD]OFF[/TD]
[TD]OFF[/TD]
[TD]13:30[/TD]
[TD]13:30[/TD]
[TD]13:30[/TD]
[TD]13:30[/TD]
[/TR]
[TR]
[TD]1073237[/TD]
[TD]Pink Floyd[/TD]
[TD]Martin Fernandes[/TD]
[TD]Vacation[/TD]
[TD]05:30[/TD]
[TD]Vacation[/TD]
[TD]Vacation[/TD]
[TD]Vacation[/TD]
[TD]Vacation[/TD]
[TD]Vacation[/TD]
[/TR]
[TR]
[TD]1072766[/TD]
[TD]Phill Collins[/TD]
[TD]Anson Palio[/TD]
[TD]13:30[/TD]
[TD]13:30[/TD]
[TD]13:30[/TD]
[TD]13:30[/TD]
[TD]13:30[/TD]
[TD]OFF[/TD]
[TD]OFF[/TD]
[/TR]
[TR]
[TD]1071247[/TD]
[TD]Sam Richardson[/TD]
[TD]Ricardo Bravo[/TD]
[TD]20:30[/TD]
[TD]20:30[/TD]
[TD]20:30[/TD]
[TD]20:30[/TD]
[TD]20:30[/TD]
[TD]OFF[/TD]
[TD]OFF[/TD]
[/TR]
[TR]
[TD]1070905[/TD]
[TD]Samantha Fox[/TD]
[TD]Martin Fernandes[/TD]
[TD]20:30[/TD]
[TD]20:30[/TD]
[TD]20:30[/TD]
[TD]20:30[/TD]
[TD]OFF[/TD]
[TD]OFF[/TD]
[TD]20:30[/TD]
[/TR]
[TR]
[TD]1070272[/TD]
[TD]Anifa Sequeira[/TD]
[TD]Anson Palio[/TD]
[TD]OFF[/TD]
[TD]11:30[/TD]
[TD]11:30[/TD]
[TD]11:30[/TD]
[TD]11:30[/TD]
[TD]11:30[/TD]
[TD]OFF[/TD]
[/TR]
[TR]
[TD]1067361[/TD]
[TD]Poison Ivy[/TD]
[TD]Ricardo Bravo[/TD]
[TD]Vacation[/TD]
[TD]Vacation[/TD]
[TD]Vacation[/TD]
[TD]Vacation[/TD]
[TD]Vacation[/TD]
[TD]Vacation[/TD]
[TD]Vacation[/TD]
[/TR]
[TR]
[TD]1067150[/TD]
[TD]Anthony Stallon[/TD]
[TD]Martin Fernandes[/TD]
[TD]07:30[/TD]
[TD]07:30[/TD]
[TD]OFF[/TD]
[TD]07:30[/TD]
[TD]07:30[/TD]
[TD]07:30[/TD]
[TD]OFF[/TD]
[/TR]
[TR]
[TD]1073477[/TD]
[TD]Joshua Fernandez[/TD]
[TD]Anson Palio[/TD]
[TD]OFF[/TD]
[TD]OFF[/TD]
[TD]13:30[/TD]
[TD]13:30[/TD]
[TD]13:30[/TD]
[TD]13:30[/TD]
[TD]13:30[/TD]
[/TR]
[TR]
[TD]1067068[/TD]
[TD]Jude Patrick[/TD]
[TD]Ricardo Bravo[/TD]
[TD]12:30[/TD]
[TD]12:30[/TD]
[TD]OFF[/TD]
[TD]OFF[/TD]
[TD]12:30[/TD]
[TD]12:30[/TD]
[TD]12:30[/TD]
[/TR]
[TR]
[TD]1073839[/TD]
[TD]Barry Heldt[/TD]
[TD]Martin Fernandes[/TD]
[TD]18:30[/TD]
[TD]18:30[/TD]
[TD]18:30[/TD]
[TD]OFF[/TD]
[TD]OFF[/TD]
[TD]18:30[/TD]
[TD]18:30[/TD]
[/TR]
[TR]
[TD]1062698[/TD]
[TD]Ben Isaac[/TD]
[TD]Anson Palio[/TD]
[TD]07:30[/TD]
[TD]07:30[/TD]
[TD]07:30[/TD]
[TD]OFF[/TD]
[TD]OFF[/TD]
[TD]07:30[/TD]
[TD]07:30[/TD]
[/TR]
[TR]
[TD]1072024[/TD]
[TD]Christopher R[/TD]
[TD]Martin Fernandes[/TD]
[TD]11:30[/TD]
[TD]11:30[/TD]
[TD]11:30[/TD]
[TD]11:30[/TD]
[TD]11:30[/TD]
[TD]OFF[/TD]
[TD]OFF[/TD]
[/TR]
[TR]
[TD]1064043[/TD]
[TD]Clifford Das[/TD]
[TD]Anson Palio[/TD]
[TD]12:30[/TD]
[TD]12:30[/TD]
[TD]12:30[/TD]
[TD]12:30[/TD]
[TD]Vacation[/TD]
[TD]OFF[/TD]
[TD]OFF[/TD]
[/TR]
[TR]
[TD]1073989[/TD]
[TD]Morten Harket[/TD]
[TD]Ricardo Bravo[/TD]
[TD]16:30[/TD]
[TD]16:30[/TD]
[TD]16:30[/TD]
[TD]16:30[/TD]
[TD]16:30[/TD]
[TD]OFF[/TD]
[TD]OFF[/TD]
[/TR]
[TR]
[TD]1073533[/TD]
[TD]Delphinia Dkhar[/TD]
[TD]Anson Palio[/TD]
[TD]16:30[/TD]
[TD]16:30[/TD]
[TD]16:30[/TD]
[TD]OFF[/TD]
[TD]OFF[/TD]
[TD]16:30[/TD]
[TD]16:30[/TD]
[/TR]
[TR]
[TD]1067367[/TD]
[TD]Cheryl Rodrigues[/TD]
[TD]Martin Fernandes[/TD]
[TD]09:30[/TD]
[TD]09:30[/TD]
[TD]09:30[/TD]
[TD]09:30[/TD]
[TD]Vacation[/TD]
[TD]OFF[/TD]
[TD]OFF[/TD]
[/TR]
</tbody>[/TABLE]


I have 90 such entries.

Each person works for 9 hours straight.

I don't bother about breaks.

Below are the shifts we operate:

SHIFT TIMINGS:
[TABLE="width: 186"]
<colgroup><col><col><col></colgroup><tbody>[TR]
[TD]Sr. No.[/TD]
[TD]Start Time[/TD]
[TD]End Time[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]05:30[/TD]
[TD]14:30[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]07:30[/TD]
[TD]16:30[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]09:30[/TD]
[TD]18:30[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]11:30[/TD]
[TD]20:30[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]12:30[/TD]
[TD]21:30[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]13:30[/TD]
[TD]22:30[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]14:30[/TD]
[TD]23:30[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]16:30[/TD]
[TD]01:30[/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD]17:30[/TD]
[TD]02:30[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]18:30[/TD]
[TD]03:30[/TD]
[/TR]
[TR]
[TD]11[/TD]
[TD]20:30[/TD]
[TD]05:30[/TD]
[/TR]
[TR]
[TD]12[/TD]
[TD]21:30[/TD]
[TD]06:30[/TD]
[/TR]
[TR]
[TD]13[/TD]
[TD]22:30[/TD]
[TD]07:30[/TD]
[/TR]
</tbody>[/TABLE]

SUGGESTED OUTPUT: (Could be incorrect.. I did this manually!)
[TABLE="width: 640"]
<colgroup><col width="80" span="8" style="width:60pt"> </colgroup><tbody>[TR]
[TD="width: 80"][TABLE="width: 640"]
<colgroup><col><col><col><col span="5"></colgroup><tbody>[TR]
[TD][/TD]
[TD]14-Oct-18[/TD]
[TD]15-Oct-18[/TD]
[TD]16-Oct-18[/TD]
[TD]17-Oct-18[/TD]
[TD]18-Oct-18[/TD]
[TD]19-Oct-18[/TD]
[TD]20-Oct-18[/TD]
[/TR]
[TR]
[TD]05:30[/TD]
[TD]0[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]06:00[/TD]
[TD]0[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]06:30[/TD]
[TD]0[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]07:00[/TD]
[TD]0[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]07:30[/TD]
[TD]2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]08:00[/TD]
[TD]2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]08:30[/TD]
[TD]2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]09:00[/TD]
[TD]2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]09:30[/TD]
[TD]2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]10:00[/TD]
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
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]03:30[/TD]
[TD]1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]04:00[/TD]
[TD]1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]04:30[/TD]
[TD]1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]05:00[/TD]
[TD]1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD="class: xl67, width: 80"][/TD]
[TD="class: xl67, width: 80"][/TD]
[TD="class: xl67, width: 80"][/TD]
[TD="class: xl67, width: 80"][/TD]
[TD="class: xl67, width: 80"][/TD]
[TD="class: xl67, width: 80"][/TD]
[TD="class: xl67, width: 80"][/TD]
[/TR]
</tbody>[/TABLE]

I am looking for a formula like Sumproduct. Please avoid VBA :).

Await your reply.

Thanks

martin
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
I put the new table on another sheet. Try:


Book1
ABCDEFGH
114-Oct-1815-Oct-1816-Oct-1817-Oct-1818-Oct-1819-Oct-1820-Oct-18
25:300100000
36:000100000
46:300100000
57:000100000
67:302311121
78:002311121
88:302311121
99:002311121
109:303422121
1110:003422121
1210:303422121
1311:003422121
1411:304644331
1512:004644331
1612:306855442
1713:006855442
1813:308978764
1914:008978764
2014:308878764
2115:008878764
2215:308878764
2316:008878764
2416:308888754
2517:008888754
2617:308888754
2718:008888754
2818:308887765
2919:008887765
3019:308887765
3120:008887765
3220:309899878
3321:009899878
3421:307688767
3522:007688767
3622:305565445
3723:005565445
3823:305565445
390:005565445
400:305565445
411:005565445
421:303344334
432:003344334
442:303344334
453:003344334
463:302234323
474:002234323
484:302234323
495:002234323
Sheet2
Cell Formulas
RangeFormula
B2=COUNTIFS(Sheet1!D$2:D$40,">"&IF($A2<=5/24,$A2+15/24,$A2-9/24),Sheet1!D$2:D$40,"<="&IF($A2<=5/24,$A2+1,$A2))


Copy down and across as needed. Let us know how it works, I got several variances from your example.
 
Upvote 0
Thanks Eric. It seems to be a perfect fit. I believe it is accurate... however will audit the same and get back. Thanks a million.
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,774
Members
452,353
Latest member
strainu

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