Weekly rotating names in calendar year

Lindap7575

New Member
Joined
Oct 30, 2023
Messages
2
Office Version
  1. 365
Platform
  1. Windows
This may be way over my excel knowledge, but I have 13 names that I need to rotate in a calendar year - our weeks start on Friday and end on Friday. I honestly don't know where or how to begin, and I have been searching and reading and can't find a simple tool to create this? Is there something that can create this rotating schedule? Technically each person shouldn't have to be on call 1 x per 13 weeks, but due to holidays it gets adjusted, so the same people do not have the holiday year after year. Is there a simple tutorial I should be looking up to do this? Thank you! :-)
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Welcome to the MrExcel board!
A few questions: Your weeks begin on Fridays, but are weekends to be considered? Which days are considered weekends? (assuming Saturday and Sunday, but would like to confirm)
It sounds as if this is an "on call" schedule. Does that mean you are looking to assign only one name for each day to consider?
For weeks near end of year and beginning of year, to which "year" does that week belong if the week includes New Year's Day?
 
Last edited:
Upvote 0
Welcome to the MrExcel board!
A few questions: Your weeks begin on Fridays, but are weekends to be considered? Which days are considered weekends? (assuming Saturday and Sunday, but would like to confirm)
It sounds as if this is an "on call" schedule. Does that mean you are looking to assign only one name for each day to consider?
For weeks near end of year and beginning of year, to which "year" does that week belong if the week includes New Year's Day?
Hi - so it's an on call schedule for physicians, they start at 5pm on Friday and end at 8am the following Friday. So for this week the week starts 11/3 @ 5pm and will end 11/10 @ 8am. So going into 2024 my first week would be 1/5 through 1/12- so i just want to have all the weeks listed and the names just auto populate rotating and not just copy and paste continuously through the year.
 
Upvote 0
Check to see if something like this will work. Input the year of interest in cell B1 and add to the Names table the staff who will be assigned (in the order they are to be assigned). The single formula should then "spill" (using Excel 365) the results for the entire year.
MrExcel_20231030_B.xlsx
ABCD
1Year2023Names
2name1
3Datename2
4Friday, January 6, 2023name1name3
5Friday, January 13, 2023name2name4
6Friday, January 20, 2023name3
7Friday, January 27, 2023name4
8Friday, February 3, 2023name1
9Friday, February 10, 2023name2
10Friday, February 17, 2023name3
11Friday, February 24, 2023name4
12Friday, March 3, 2023name1
13Friday, March 10, 2023name2
14Friday, March 17, 2023name3
15Friday, March 24, 2023name4
16Friday, March 31, 2023name1
Sheet2
Cell Formulas
RangeFormula
A4:B55A4=LET(names,Table2[Names],wkary,SEQUENCE(QUOTIENT(DAYS(CEILING(DATE($B$1+1,1,1)-6,7)+6,CEILING(DATE($B$1,1,1)-6,7)+6)+1,7),,CEILING(DATE($B$1,1,1)-6,7)+6,7),nary,INDEX(names,MOD(SEQUENCE(ROWS(wkary),,0),COUNTA(names))+1),HSTACK(wkary,nary))
Dynamic array formulas.
 
Upvote 1
If you want to do this every year, then the formula can be simplified a bit by replacing the portion that calculates the number of weeks between two dates with 52...like this:
Excel Formula:
=LET(names,Table2[Names],wkary,SEQUENCE(52,,CEILING(DATE($B$1,1,1)-6,7)+6,7),nary,INDEX(names,MOD(SEQUENCE(ROWS(wkary),,0),COUNTA(names))+1),HSTACK(wkary,nary))
 
Upvote 1
If you want to do this every year, then the formula can be simplified a bit by replacing the portion that calculates the number of weeks between two dates with 52...like this:
Excel Formula:
=LET(names,Table2[Names],wkary,SEQUENCE(52,,CEILING(DATE($B$1,1,1)-6,7)+6,7),nary,INDEX(names,MOD(SEQUENCE(ROWS(wkary),,0),COUNTA(names))+1),HSTACK(wkary,nary))
Hello, can this same formula be modified to include only weekends and holidays? Can you help me with the formula, please?
 
Upvote 0
Can you tell me more, please? The solution above shows the Friday start date for every week in the calendar year.
  1. See my questions in post #2...are you considering Saturday and Sunday as weekends, or something else?
  2. Are you looking for a list of list of single dates...each row containing only one date that falls on either a weekend or a holiday? Or do you want the entire weekend represented by a single cell? In other words, for the year, are you anticipating about 52 rows of weekend dates (each row representing Saturday-Sunday presumably), or 104 rows of a weekend days?
  3. Do you have any rules for what constitutes a "holiday"? For example, if a traditional holiday falls on a weekend day, is the holiday to be ignored, or is it celebrated (for your scheduling purposes) on the day before or the day after the weekend?
 
Upvote 1
Hi KRice, thank you for getting back to me so quickly.
1. I want to consider weekends (Saturday and Sunday) plus the Holidays (listed below) as 'working' days and assign employees to work on the specified weekends and holidays.
2. I want each weekend day and holiday represented by a single cell with the corresponding employee in the adjacent column.
3. I was able to include weekends using your formula but I don't know how to include holidays as well. The holidays I listed below are all on weekdays.
4. One other separate but related question, is there a way to randomize but not cluster which employee is assigned to work so that one employee is not working two weekends in a row for example?

1701918498401.png

1
 
Upvote 0
Your approach should work fine...almost there. The easiest adjustment is to rename the weekend dates array as "weary"...only to avoid potential confusion with the earlier formula. Then add an array for the holiday (to work) dates (I've called it "hary", and this holidays array refers to a range...you could also reference the Holidays table in your worksheet). Then stack those two arrays together vertically and sort them (see the SORT(VSTACK construction) to create an "all days array"...which I named "adary". This gives you all the Saturdays, Sundays, and Holiday dates in a single vertical array. Then the names array "nary" is formed by considering the new overall length of adary, and the INDEX/MOD/SEQUENCE construction gives a repeating sequence of your Names list (this is one way to do it). Finally, those two arrays (adary and nary) are stacked horizontally and returned by the formula.

The only issue may be to confirm whether your boundaries are correct...is the first date to appear always in the calendar year shown in A1? Is it conceivable the the last date to appear might be in the early days of the subsequent year?
MrExcel_20231030_B.xlsx
ABCDEI
12024NamesList of Holidays
2Monday, January 1, 2024name1name1Monday, January 1, 2024
3Tuesday, January 2, 2024name2name2Tuesday, January 2, 2024
4Saturday, January 6, 2024name3name3Monday, January 15, 2024
5Sunday, January 7, 2024name4name4Monday, February 19, 2024
6Saturday, January 13, 2024name5name5Friday, April 5, 2024
7Sunday, January 14, 2024name6name6Monday, May 27, 2024
8Monday, January 15, 2024name7name7Thursday, July 4, 2024
9Saturday, January 20, 2024name8name8Friday, August 9, 2024
10Sunday, January 21, 2024name1Monday, September 2, 2024
11Saturday, January 27, 2024name2Thursday, November 28, 2024
12Sunday, January 28, 2024name3Friday, November 29, 2024
13Saturday, February 3, 2024name4Tuesday, December 24, 2024
14Sunday, February 4, 2024name5Wednesday, December 25, 2024
15Saturday, February 10, 2024name6Tuesday, December 31, 2024
16Sunday, February 11, 2024name7
17Saturday, February 17, 2024name8
Luu_WE-HOL
Cell Formulas
RangeFormula
A2:B119A2=LET(names,Table25[Names],weary,WORKDAY.INTL(DATE($A$1,1,1),SEQUENCE(104),"1111100"),hary,I2:I15,adary,SORT(VSTACK(weary,hary)),nary,INDEX(names,MOD(SEQUENCE(ROWS(adary),,0),COUNTA(names))+1),HSTACK(adary,nary))
Dynamic array formulas.
 
Upvote 1
Dear Kirk, Just Brilliant!
Yes, and yes to both of your questions. I would like the beginning date to start with Jan of the previous year and the last date to go into January of the subsequent year.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,178
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