Calculating Days off required

Status
Not open for further replies.

Keegan4123

New Member
Joined
Mar 30, 2022
Messages
29
Office Version
  1. 2016
Platform
  1. Windows
So we have a running google sheet that tracks when an employee works. We run under labor laws that allow for a maximum of 24 days worked straight, and then require 4 consecutive days off. Essentially its 1 day off for every 6 days worked. they must be consecutive to reset the clock.

So you can work a 6 and 1 or a 12 and 2, but could not work a 12 and 1, and then a 12 and 2. this would put them over their days because the 1 day off would not have reset the clock so they are technically on day 25 and would need 4 off consecutive to reset.

I have a mini sheet attached in excel, for figuring it out, but the ultimate sheet will be in google and allow the workbook to update with days worked automatically. The biggest concern in the mini sheet is the forumula in column B. The sheet will be auto filled as days go buy with 1 for a day worked and blank for a day off. I will also be creating columns for every day of the year and hiding them.

I initially tried doing a simple sumif to get the total days worked for a period that summed the days between today and 28 days prior. if the number went over 24, we had an issue, but looking at a few that flagged, they were still in compliance.
Days Worked 2022.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAA
1Today is15/06/2022
2MonthDays Left Before Mandatory 4 day ResetExplanation comments, wont be in spreadsheetJun 15Jun 14Jun 13Jun 12Jun 11Jun 10Jun 9Jun 8Jun 7Jun 6Jun 5Jun 4Jun 3Jun 2Jun 1May 31May 30May 29May 28May 27May 26May 25May 24May 23
3Staff 1 (as it should be)14Had 4 days off prior to working 10, so has 14 left 111111111111111111
4Staff 1 (incorrect)142 days off in middle doesn’t reset previous days, so actually only has 2 days left before they have to reset1111111111111111111111
5Staff 1 (incorrect)17Single days off don’t reset cause its more than 6 so only has 2 days left 1111111111111111111111
6
7
8Rules:Days off must be consecutive
91 day off for every 6 worked
102 days off for every 12 worked
113 days off for every 18 worked
124 days off for every 24 worked
13
14
15
DaysWorked
Cell Formulas
RangeFormula
B1B1=TODAY()
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2,D2:XFD2Cell Value=$B$1textNO
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Status
Not open for further replies.

Forum statistics

Threads
1,223,341
Messages
6,171,546
Members
452,409
Latest member
brychu

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