Groups/Arrays/Patterns Help

BlueNoteStan

New Member
Joined
Dec 19, 2023
Messages
3
Office Version
  1. 365
Platform
  1. Windows
Strap in, this is gonna be long and possibly confusing.

I have to test and record the first and last data point in groups of 25. Each quarter, the iterations change, so in Q1, I'm testing 1, 25, 26, 50, 51, 75, 76, 100. . . In Q2, I'm testing 2, 24, 27, 49, 52, 74, 77, 99. . . and so on.

These pattern works great with the formula: =IF(MOD(ROW(),25)=1,"TEST",IF(MOD(ROW(),25)=0,"TEST","")) in the first column, and then =IF(MOD(ROW(),25)=2,"TEST",IF(MOD(ROW(),25)=24,"TEST","")) in the next and so on. This gives me a very pleasing pattern:

1703006434091.png


This would solve my problem, but in my groups of 25, some of them are not able to be tested. For example, in my first group of 25, only numbers 10, 11, 13, 15, 17, and 22 are able to be tested. I have a column (Column B on my actual sheet) dedicated to labeling which are able to be tested with strings "OCCUPIED" and "OPEN". I would like a formula that checks column B for the string "OPEN" in each group of 25 and capturing those rows in an array, then using this array to populate the string "TEST".

In this example, row 10 and 22 are the first and last rows in this array, they should have "TEST" in the column I copy the formula. In the next column, rows 11 and 17 are the next iteration of the pattern, and they should have the string "TEST" and so on.

I would like this pattern to be able to populate this string in up to 120 groups of 25 (basically, I'll need the formula to check every group of 25 for the range I copy it to).

I've been racking my brain for months trying to figure this out, but I can't seem to get the logic right and I keep getting a lot of errors. I would really appreciate any and all help with this formula!
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
I'm not too sure about the whole output needed:

MrExcelPlayground20.xlsx
ABCDEFGHIJKLMNO
1PointTest?Q1Q2Q3Q4Q5Q6Q7Q8Q9Q10Q11Q12Q13
21 
32
43
54
65
76
87
98
109
1110OPENTESTTESTTESTTESTTEST
1211OPENTESTTESTTESTTEST
1312
1413OPENTESTTESTTESTTEST
1514
1615OPENTESTTESTTESTTEST
1716
1817OPENTESTTESTTESTTEST
1918
2019
2120
2221
2322OPENTESTTESTTESTTESTTEST
2423
2524
2625
Sheet19
Cell Formulas
RangeFormula
A2:A26A2=SEQUENCE(25)
C2:O26C2=LET(a,A2#,b,B2:B26,c,FILTER(a,b="OPEN"),dd,ROWS(c),d,INT(ROWS(c)/2+0.5),e,MMULT(c,SEQUENCE(1,13,1,0)),f,MOD(SEQUENCE(1,13)-1,d)+1,g,IF(ISEVEN(dd),(2*d+2)-f-1,(2*d+1)-f-1),h,INDEX(c,f),I,INDEX(c,g),j,IF((a=h)+(a=I),1,0),k,IF(j=1,"TEST",""),k)
Dynamic array formulas.
 
Upvote 1
I'm not too sure about the whole output needed:

MrExcelPlayground20.xlsx
ABCDEFGHIJKLMNO
1PointTest?Q1Q2Q3Q4Q5Q6Q7Q8Q9Q10Q11Q12Q13
21 
32
43
54
65
76
87
98
109
1110OPENTESTTESTTESTTESTTEST
1211OPENTESTTESTTESTTEST
1312
1413OPENTESTTESTTESTTEST
1514
1615OPENTESTTESTTESTTEST
1716
1817OPENTESTTESTTESTTEST
1918
2019
2120
2221
2322OPENTESTTESTTESTTESTTEST
2423
2524
2625
Sheet19
Cell Formulas
RangeFormula
A2:A26A2=SEQUENCE(25)
C2:O26C2=LET(a,A2#,b,B2:B26,c,FILTER(a,b="OPEN"),dd,ROWS(c),d,INT(ROWS(c)/2+0.5),e,MMULT(c,SEQUENCE(1,13,1,0)),f,MOD(SEQUENCE(1,13)-1,d)+1,g,IF(ISEVEN(dd),(2*d+2)-f-1,(2*d+1)-f-1),h,INDEX(c,f),I,INDEX(c,g),j,IF((a=h)+(a=I),1,0),k,IF(j=1,"TEST",""),k)
Dynamic array formulas.


This works great! Thank you so much! I never would've thought to make that formula. Is there a way to repeat this down all the way to row 3000 if necessary? The only way I can see to do it currently is to repeat the SEQUENCE formula in A26, and your LET formula in C26, and update the target cells for the new location. I would have to do this 172 times 😥 and that kinda sucks 😅.

If that's possible, I'd appreciate the help!
 
Upvote 0
I'm not sure I understood your whole question - and going down to 3000 is part of it. You'd want it to go from 1 to 25 120 times? (172?) Where in column B you would have different sets of "OPEN" or not? for each group of 25? But each set of 25 is essentially it's own independent output?

However, if you just highlight A2:O26, and then drag that down to row 3000, it'll just take a minute, and you have 120 independent properly working groups of 25. Updating Column B would be tedious.
 
Upvote 0
I'm not sure I understood your whole question - and going down to 3000 is part of it. You'd want it to go from 1 to 25 120 times? (172?) Where in column B you would have different sets of "OPEN" or not? for each group of 25? But each set of 25 is essentially it's own independent output?

However, if you just highlight A2:O26, and then drag that down to row 3000, it'll just take a minute, and you have 120 independent properly working groups of 25. Updating Column B would be tedious.
I apologize for the lack of detail.

I would want the sequence to go from 1-3000, but each group of 25 to act like an independent working group. I've tried dragging down the A2:O26 range to 3000 and it functions just how I'd need it to, but the sequence in column A is just 1-25 repeating. If there's a way to increment the sequence so that the starting number is the previous starting number +1, that would be ideal.

And yes, updating column B with OPENs was tedious 😅

If I haven't said it before, I appreciate you!
 
Upvote 0
This is easy enough to sort out - change A2 as below and the small change in C2, and then drag B2:O26 down to 3000.

MrExcelPlayground20.xlsx
ABCDEFGHIJKLMNO
1PointTest?Q1Q2Q3Q4Q5Q6Q7Q8Q9Q10Q11Q12Q13
21 
32
43
54
65
76
87
98
109
1110OPENTESTTESTTESTTESTTEST
1211OPENTESTTESTTESTTEST
1312
1413OPENTESTTESTTESTTEST
1514
1615OPENTESTTESTTESTTEST
1716
1817OPENTESTTESTTESTTEST
1918
2019
2120
2221
2322OPENTESTTESTTESTTESTTEST
2423
2524
2625
2726 
2827
2928
3029OpenTESTTESTTESTTEST
3130
3231
3332OpenTESTTESTTEST
3433
3534
3635
3736
3837OpenTESTTESTTEST
3938OPENTESTTESTTEST
4039
4140
4241
4342OPENTESTTESTTEST
4443
4544OPENTESTTESTTEST
4645
4746
4847
4948OPENTESTTESTTEST
5049
5150OPENTESTTESTTESTTEST
Sheet19
Cell Formulas
RangeFormula
A2:A3001A2=SEQUENCE(3000)
C2:O51C2=LET(a,A2:A26,b,B2:B26,c,FILTER(a,b="OPEN"),dd,ROWS(c),d,INT(ROWS(c)/2+0.5),e,MMULT(c,SEQUENCE(1,13,1,0)),f,MOD(SEQUENCE(1,13)-1,d)+1,g,IF(ISEVEN(dd),(2*d+2)-f-1,(2*d+1)-f-1),h,INDEX(c,f),I,INDEX(c,g),j,IF((a=h)+(a=I),1,0),k,IF(j=1,"TEST",""),k)
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,224,889
Messages
6,181,611
Members
453,056
Latest member
apmale77

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