Creating Heat Chart for Schedules

EricGoBills

New Member
Joined
Jun 19, 2018
Messages
2
Hello,

First post on here but have used this site countless times as a reference.

I am creating a heat chart for staffing purposes to show how many people are on shift for a specific day/time.


The first sheet has schedule info (Name, Start Time, End Time, and 1/0 for each day of the week they work)


ABCDEFGHIJKL
1Name
SundayMondayTuesdayWednesdayThursdayFridaySaturdayStart ESTEnd ESTDurationShift
2John11111006:0014:308:30A
3Jane111110013:0022:009:00B
4Jack001111122:007:009:00C

<tbody>
</tbody>


The second sheet is where I am creating my heat chart. Using the following formula it will calculate for everyone except the employees who work the overnight. (end shift < start shift)

(formula from cell B3)

=SUMIFS(Schedule!$B:$B,Schedule!$B:$B,1,Schedule!$I:$I,"<="&B$2,Schedule!$J:$J,">"&B$2)



A
B
C
D
E
F
G
H
I
J
K
L
1
2
12:00:00 AM12:30:00 AM1:00:00 AM1:30:00 AM2:00:00 AM2:30:00 AM3:00:00 AM3:30:00 AM4:00:00 AM4:30:00 AM5:00:00 AM
3
Sunday00000000000
4
Monday00000000000
5
Tuesday00000000000
6
Wednesday00000000000
7
Thursday00000000000
8
Friday00000000000
9
Saturday00000000000

<tbody>
</tbody>



Looking for any suggestions on how to incorporate the overnight shifts into this formula. ("Jack" in the example) I have played with IF statements checking if Start Time > End Time, but can't seem to get it to work.
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Try this:



Worksheet Formulas
CellFormula
K2=MOD(J2-I2,1)

<thead>
</thead><tbody>
</tbody>


and drag down

Worksheet Formulas
CellFormula
B7=SUMPRODUCT(N(B$2:B$4=1),N($I$2:$I$4<=$A7),N($I$2:$I$4+$K$2:$K$4>=$A7))+SUMPRODUCT(N(H$2:H$4=1),N($I$2:$I$4+$K$2:$K$4>=(1+$A7)))
C7=SUMPRODUCT(N(C$2:C$4=1),N($I$2:$I$4<=$A7),N($I$2:$I$4+$K$2:$K$4>=$A7))+SUMPRODUCT(N(B$2:B$4=1),N($I$2:$I$4+$K$2:$K$4>=(1+$A7)))
D7=SUMPRODUCT(N(D$2:D$4=1),N($I$2:$I$4<=$A7),N($I$2:$I$4+$K$2:$K$4>=$A7))+SUMPRODUCT(N(C$2:C$4=1),N($I$2:$I$4+$K$2:$K$4>=(1+$A7)))
E7=SUMPRODUCT(N(E$2:E$4=1),N($I$2:$I$4<=$A7),N($I$2:$I$4+$K$2:$K$4>=$A7))+SUMPRODUCT(N(D$2:D$4=1),N($I$2:$I$4+$K$2:$K$4>=(1+$A7)))
F7=SUMPRODUCT(N(F$2:F$4=1),N($I$2:$I$4<=$A7),N($I$2:$I$4+$K$2:$K$4>=$A7))+SUMPRODUCT(N(E$2:E$4=1),N($I$2:$I$4+$K$2:$K$4>=(1+$A7)))
G7=SUMPRODUCT(N(G$2:G$4=1),N($I$2:$I$4<=$A7),N($I$2:$I$4+$K$2:$K$4>=$A7))+SUMPRODUCT(N(F$2:F$4=1),N($I$2:$I$4+$K$2:$K$4>=(1+$A7)))
H7=SUMPRODUCT(N(H$2:H$4=1),N($I$2:$I$4<=$A7),N($I$2:$I$4+$K$2:$K$4>=$A7))+SUMPRODUCT(N(G$2:G$4=1),N($I$2:$I$4+$K$2:$K$4>=(1+$A7)))

<thead>
</thead><tbody>
</tbody>



and drag down



ABCDEFGHIJKL
1NameSundayMondayTuesdayWednesdayThursdayFridaySaturdayStart ESTEnd ESTDurationShift
2John11111006:0014:308:30A
3Jane111110013:0022:009:00B
4Jack001111122:007:009:00C
5
6SundayMondayTuesdayWednesdayThursdayFridaySaturday
700:001001111
800:301001111
901:001001111
1001:301001111
1102:001001111
1202:301001111
1303:001001111
1403:301001111
1504:001001111
1604:301001111
1705:001001111
1805:301001111
1906:002112211
2006:302112211
2107:002112211
2207:301111100
2308:001111100
2408:301111100
2509:001111100
2609:301111100
2710:001111100
2810:301111100
2911:001111100
3011:301111100
3112:001111100
3212:301111100
3313:002222200
3413:302222200
3514:002222200
3614:302222200
3715:001111100
3815:301111100
3916:001111100
4016:301111100
4117:001111100
4217:301111100
4318:001111100
4418:301111100
4519:001111100
4619:301111100
4720:001111100
4820:301111100
4921:001111100
5021:301111100
5122:001122211
5222:300011111
5323:000011111
5423:300011111

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet2
 
Upvote 0

Forum statistics

Threads
1,214,657
Messages
6,120,769
Members
448,991
Latest member
Hanakoro

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