Shift bands

Jwinssss

New Member
Joined
Jan 17, 2024
Messages
19
Office Version
  1. 2019
Platform
  1. Windows
Hi everyone,

I am struggling to find a formula to calculate "shift premium times" for a 24/7 transport office.

I need to be able to calculate if a driver's work carries over three time bands, and if so, how many hours has been worked in each Time Band.

This would be for his week of work so driver there would be multiple start and finish times

Shift pattern Time Bands are:

Band A - 04:00 - 10:00
Band B - 10:00 - 18:00
Band C - 18:00 - 04:00
-------------------------------------------------------------

Example one;

Start 09:00
Finish 20:00

Driver has worked 1 hours Band A, 8 hours Band B, 1 hour Band C
--------------------------------------------------------------

But
Friday from 16:00 - 18:00 it’s Saturday rate
So it if a driver starts at 17:00 on the Friday it should say in the Saturday 1 hour Band B

Sat from 16:00 - 18:00 it’s Sunday rate
This should show on the Sunday rate
So if the driver starts at 17:00 it’s 1 hour Sunday band b

Sunday from 16:00 - 18:00 it’s Monday rate

Same as above

I can calculate the total number of hours worked, but not how many hours worked in each band... any help will be appreciated before I go completely mad

Thank you,
 
How could I go about adding in extra bands for like Christmas Day,Boxing Day and bank holidays ?
 
Upvote 0

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Ok here it is:
File to download:ShiftBands4.zip

Now for this to work correctly you have to have all days that Jim (in this example) worked.
So one line for friday, one line for saturday, so that the hours from saturday are calculated adding the actual hours from saturday plus the B and C bands from friday.
The column B2 and C2 (K and L) are only helper columns. The hours of that appear in this columns are added the next day (one row below) if the date in columna DATE (A) if the next day is the consecutive day and only if it is saturday, sunday or monday.
I seems to me that it is working as expected.
Please try it out and let me know.


ShiftBands4.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAA
1Hours worked by bands
2DATESurnameForenameTime InTime OutTotal hoursTo be paid [USD]ABCB2C2BandRateDescriptionFromToMonTueWedThuFriSatSun
32024-01-11 (Thu)Jim09:0020:0011:00230.001:008:002:00--A10.0000:0001:00CCCCCCC
42024-01-12 (Fri)Jim09:0020:007:00130.001:006:00-2:002:00B20.0001:0002:00CCCCCCC
52024-01-13 (Sat)Jim09:0020:0011:00230.001:008:002:002:002:00C30.0002:0003:00CCCCCCC
62024-01-14 (Sun)Jim09:0020:0011:00230.001:008:002:002:002:0003:0004:00CCCCCCC
72024-01-15 (Mon)Jim09:0020:0015:00330.001:0010:004:00--04:0005:00AAAAAAA
82024-01-16 (Tue)Jim09:0020:0011:00230.001:008:002:00--05:0006:00AAAAAAA
906:0007:00AAAAAAA
1007:0008:00AAAAAAA
1108:0009:00AAAAAAA
1209:0010:00AAAAAAA
1310:0011:00BBBBBBB
1411:0012:00BBBBBBB
1512:0013:00BBBBBBB
1613:0014:00BBBBBBB
1714:0015:00BBBBBBB
1815:0016:00BBBBBBB
1916:0017:00BBBBB2B2B2
2017:0018:00BBBBB2B2B2
2118:0019:00CCCCC2C2C2
2219:0020:00CCCCC2C2C2
2320:0021:00CCCCC2C2C2
2421:0022:00CCCCC2C2C2
2522:0023:00CCCCC2C2C2
2623:0024:00CCCCC2C2C2
27
Excel 2019
Cell Formulas
RangeFormula
F3:F8F3=SUM(H3:J3)
G3:G8G3=SUM(($H$2:$J$2=RateBands[Band])*RateBands[Rate]*$H3:$J3)*24
H3:H8,K3:L8H3=IFERROR(SUM((INDEX($T$3:$Z$26, N(IF({1},INT(VALUE(TEXT((($A3+$D3)+(ROW(INDIRECT("A1:A"&ROUND((($A3+$E3+($E3<$D3))-($A3+$D3))/TIME(0,1,0),0)))-1)*TIME(0,1,0)), "hh:mm"))/TIME(1,0,0))+1)), N(IF({1}, WEEKDAY((($A3+$D3)+(ROW(INDIRECT("A1:A"&ROUND((($A3+$E3+($E3<$D3))-($A3+$D3))/TIME(0,1,0),0)))-1)*TIME(0,1,0)),2))))=H$2)*1)*TIME(0,1,0),0)
I3:J8I3=IFERROR(SUM((INDEX($T$3:$Z$26, N(IF({1},INT(VALUE(TEXT((($A3+$D3)+(ROW(INDIRECT("A1:A"&ROUND((($A3+$E3+($E3<$D3))-($A3+$D3))/TIME(0,1,0),0)))-1)*TIME(0,1,0)), "hh:mm"))/TIME(1,0,0))+1)), N(IF({1}, WEEKDAY((($A3+$D3)+(ROW(INDIRECT("A1:A"&ROUND((($A3+$E3+($E3<$D3))-($A3+$D3))/TIME(0,1,0),0)))-1)*TIME(0,1,0)),2))))=I$2)*1)*TIME(0,1,0),0)+IFERROR(($A3-$A2=1)*(WEEKDAY($A3,16)<4)*($A2>0)*K2,0)
Press CTRL+SHIFT+ENTER to enter array formulas.
Cells with Conditional Formatting
CellConditionCell FormatStop If True
H2:L2,N3:N5,T3:Z26Cell Value="C2"textNO
H2:L2,N3:N5,T3:Z26Cell Value="B2"textNO
H2:L2,N3:N5,T3:Z26Cell Value="C"textNO
H2:L2,N3:N5,T3:Z26Cell Value="B"textNO
H2:L2,N3:N5,T3:Z26Cell Value="A"textNO
How could I go about adding in extra bands for like Christmas Day, Boxing Day and bank holidays ?
 
Upvote 0

Forum statistics

Threads
1,224,815
Messages
6,181,136
Members
453,021
Latest member
Justyna P

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