Try:
Book1 |
---|
|
---|
| A | B | C | D | E | F | G | H | I |
---|
1 | Start Day | # of days | # of people | Holidays | | | Date | Day/Instance | Person |
---|
2 | 1/1/2025 | 31 | 15 | 1/1/2025 | NYD | | 1/1/2025 | Holiday | |
---|
3 | | | | 1/20/2025 | MLK | | 1/2/2025 | Thursday/1 | 1 |
---|
4 | | | | 2/17/2025 | Pres | | 1/2/2025 | Thursday/2 | 2 |
---|
5 | | | | 5/26/2025 | Mem | | 1/2/2025 | Thursday/3 | 2 |
---|
6 | | | | | | | 1/3/2025 | Friday/1 | 3 |
---|
7 | | | | | | | 1/3/2025 | Friday/2 | 4 |
---|
8 | | | | | | | 1/3/2025 | Friday/3 | 4 |
---|
9 | | | | | | | 1/4/2025 | Saturday/1 | 5 |
---|
10 | | | | | | | 1/5/2025 | Sunday/1 | 6 |
---|
11 | | | | | | | 1/6/2025 | Monday/1 | 7 |
---|
12 | | | | | | | 1/6/2025 | Monday/2 | 8 |
---|
13 | | | | | | | 1/6/2025 | Monday/3 | 8 |
---|
14 | | | | | | | 1/7/2025 | Tuesday/1 | 9 |
---|
15 | | | | | | | 1/7/2025 | Tuesday/2 | 10 |
---|
16 | | | | | | | 1/7/2025 | Tuesday/3 | 10 |
---|
17 | | | | | | | 1/8/2025 | Wednesday/1 | 11 |
---|
18 | | | | | | | 1/8/2025 | Wednesday/2 | 12 |
---|
19 | | | | | | | 1/8/2025 | Wednesday/3 | 12 |
---|
|
---|
The G2 formula is a Spill formula and fills the G:H columns. The I2 formula has to be dragged down the column. Let us know if this works for you.
I managed to get it to do the 3 rows for a holiday, however following each holiday day it reverts to person 1. What needs to change on the following so if for instance person 10 was the last person before a holiday day that person 11 is shown for the next shift after the holiday. TIA
=LET(start,A2,nd,B2,hol,$D$2:$D$20,s,SEQUENCE(nd*4,,start,1/4),m,MOD(s,1),f,FILTER(s,(m=0)+((m<0.75)*(WEEKDAY(s,2)<6)*ISERROR(MATCH(INT(s),"",0)))),d,IF(ISERROR(MATCH(INT(f),hol,0)),TEXT(f,"dddd")&"/"&MOD(f,1)*4+1,"Holiday"),CHOOSE({1,2},INT(f),d))
=LET(i,RIGHT(G2,1)+0,d,N(XLOOKUP(TRUE,H$1:H1<>"",H$1:H1,,2,-1)),IF(G2="Holiday","Bank, Holiday",IF(i<2,MOD(d,$C$2)+1,d)))