Repeating Numbers in a certain Pattern

LPHBELLO

New Member
Joined
Aug 2, 2023
Messages
4
Office Version
  1. 365
Platform
  1. Windows
Hello, I've been trying to figure out a way for excel to finish and continue a pattern that I have going across from C:AG, I want it to continue to the pattern after entering the first row, and pick up where left off from AG back to C but 2 rows down from the original pattern. I have it as follows, 1,1,1,1,3,3,3,3,1,1,1,1,3,3,3,3,2,2,2,2,4,4,4,4,2,2,2,2,4,4,4,4,1,1,1,1,3,3,3,3 and repeat so on so forth. The reason for this is because I'm creating rotating shift schedules, and i rather not have to create this whole schedule by manually entering for everyday of each month. The numbers are formated from the letters, A = 1 , B = 2, C = 3, D = 4.
 

Attachments

  • Screenshot 2023-08-02 152747.png
    Screenshot 2023-08-02 152747.png
    28.3 KB · Views: 18

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
If you have actual dates in the first row, for example, 1/1/2015 in cell C1 custom-formatted as d (it's a Thursday to match your example) then the following formulas will return shift codes for the Day Shift and Night Shift:
Excel Formula:
=MID("AAAACCCCAAAACCCCBBBBDDDDBBBBDDDD",MOD(C1-23,32)+1,1)
=MID("AAAACCCCAAAACCCCBBBBDDDDBBBBDDDD",MOD(C1-7,32)+1,1)
Note: you may need to adjust the 23 and 7 constants to suit your needs.
 
Upvote 0
Welcome to the MrExcel board!

For the future, I suggest that you investigate XL2BB for providing sample data to make it easier for helpers by not having to manually type out sample data to test with.

I want it to continue to the pattern after entering the first row
This is what I came up with using only the first entered row of each shift.

23 08 03.xlsm
BCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAH
1
2
3DDAAAACCCCAAAACCCCBBBBDDDDBBBBD
4CCBBBBDDDDBBBBDDDDAAAACCCCAAAAC
5
6
7DDDAAAACCCCAAAACCCCBBBBDDDDB
8CCCBBBBDDDDBBBBDDDDAAAACCCCA
9
10
11BBBDDDDAAAACCCCAAAACCCCBBBBDDDD
12AAACCCCBBBBDDDDBBBBDDDDAAAACCCC
13
Shift Pattern
Cell Formulas
RangeFormula
C7:AD8,C11:AG12C7=LET(p,REPT(REPT("AAAACCCC",2)&REPT("BBBBDDDD",2),2),s,RIGHT(CONCAT($C3:$AG3,IF(COLUMNS($C:C)>1,INDEX(7:7,3):B7,"")),LEN(p)/2),MID(p,FIND(s,p)+LEN(s),1))
 
Upvote 0
Solution

Forum statistics

Threads
1,223,984
Messages
6,175,781
Members
452,668
Latest member
mrider123

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