WR

WR(w,c,[r],[i])
w
word
c
constant arrays (in our example cs for snake lookup, cd for diagonal lookup)
[r]
always omitted, carries the final result
[i]
always omitted, carries nr. iterations, depending of LEN(w)

Set of functions and study for solving the Word Maze Excel Challenge

Xlambda

Well-known Member
Joined
Mar 8, 2021
Messages
870
Office Version
  1. 365
Platform
  1. Windows
WR: Word maze Results challenge. Please do see latest (26-Oct-21) YT video of MrExcel Solving Word Search With Excel (FMWC) - 2439
This is a compact set of functions that can solve all lookup scenarios.
Defined names: ar, sample array ( A1:T15 ) ; rw, nr. rows of sample array (15) (width is fixed to 20) ; cs, constant array values for "snake" lookup {-1,1, 20,-20} ; cd, constant array values for "diagonal" lookup {-21,-19,19,21}

WL(l)=LAMBDA(l,LET(x,IF(ar=l,1),y,IF(ar="?",1),z,IF(x+y,1),v,IF(z,SEQUENCE(rw,20)),SMALL(v,SEQUENCE(COUNT(v)))))
WA(a,c)=LAMBDA(a,c,LET(x,a-c,y,IF(x>0,x),UNIQUE(SMALL(y,SEQUENCE(COUNT(y ))))))
WB(a,b)=LAMBDA(a,b,FILTER(a,IFNA(XMATCH(a,b,,2),0)))

WR(w,c,[r],[i ])=LAMBDA(w,c,[r],[i ],LET(n,IF(i,i,LEN(w)),x,MID(w,n,1),y,MID(w,n-1,1),z,IF(AND(r=0),WA(WL(x),c),WA(r,c)),IF(n=1,r,WR(w,c,WB(z,WL(y )),n-1))))
Last one WR is !! recursive !! Define the names, then the functions and we are good to go. (Gaps in [i ] are to keep the text no to turn italics)
Will come back with the "concept" explanation asap.
Excel Formula:
=LAMBDA(w,c,[r],[i ],LET(n,IF(i,i,LEN(w)),x,MID(w,n,1),y,MID(w,n-1,1),z,
     IF(AND(r=0),WA(WL(x),c),WA(r,c)),IF(n=1,r,WR(w,c,WB(z,WL(y)),n-1))
    )
)
WORD MAZE.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAK
1Z1SGPE2THEDIZBANTSNSdefined names
2SP?AKIWK1FHVZG2IEKAXar: A1:T15 (sample array)
3?ITQE?LASIXQJNSX4TJKrw: 15 (width is always 20)
4LENJFXA4TIKNSBX1DJCPcs: {-1,1,20,-20} (constant array for "snake" type lookup
5GDL33DMVLTGK?CU3OQOOcd: {-21,-19,19,21} (constant array for "diagonal" type lookup
6IAIUVGYLU?IEP3WGKBTP
74APAU4CZVFFFAFIPAXTT"snake" lookup"diagonal" lookup
8HN?4GCKS4IDRHNNAJDNS
9EC3XCODBVQOYJERGSKAH=WR("snake",cs)=WR("diagonal",cd)
10EX1Z?PNI3OWCCN2UREGJ382
11EONMEVKABEPFLQNZ?EW318
12KAN?AIBKLG24?N?ZBNQE20=WR("advance",cd)
13SMO4YFBBRE?DNE1ADJM416067
14CFX43TY1ZJNIWUZ3OWHM224
15TYD2YZSUDVVF4OZEKA?S300
16
17=SEQUENCE(rw,20)=WR("difficult",cs)
181234567891011121314151617181920151
192122232425262728293031323334353637383940
204142434445464748495051525354555657585960=WR("winner",cs)
216162636465666768697071727374757677787980115
2281828384858687888990919293949596979899100273
23101102103104105106107108109110111112113114115116117118119120
24121122123124125126127128129130131132133134135136137138139140
25141142143144145146147148149150151152153154155156157158159160Note: I left the results in "sequence numbers" representation on purpose,
26161162163164165166167168169170171172173174175176177178179180to be much easier to visualize the results.
27181182183184185186187188189190191192193194195196197198199200To get them to "range" representation we can use PR(a) (print results)
28201202203204205206207208209210211212213214215216217218219220PR(a)=LAMBDA(a,LET(x,QUOTIENT(a-1,20)+1,y,MOD(a-1,20)+1,ADDRESS(x,y,4)))
29221222223224225226227228229230231232233234235236237238239240
30241242243244245246247248249250251252253254255256257258259260
31261262263264265266267268269270271272273274275276277278279280C1B5
32281282283284285286287288289290291292293294295296297298299300R1
33T1G4
34Important Note: Covered here only snake and diagonal search, for being the more complicated ones.T8
35Anyhow, to cover the rest of them the only thing we have to do is defining new constant arraysD12
36cs (constant snake) {-1,1,20,-20}T15
37cd (constant diagonal) {-21,-19,19,21}
38For example, for horizontal lookup we have to defineK8
39ch {-1,1} and for vertical cv: {-20,20}
40O6
41M14
42
43
WM snake diagonal
Cell Formulas
RangeFormula
W9,W20,W17,A17,AC12,AC9W9=FORMULATEXT(W10)
W10:W15W10=WR("snake",cs)
AC10AC10=WR("diagonal",cd)
AC13AC13=WR("advance",cd)
A18:T32A18=SEQUENCE(rw,20)
W18W18=WR("difficult",cs)
W21:W22W21=WR("winner",cs)
W31:W36W31=PR(W10#)
AC31AC31=PR(AC10)
AC33,W38AC33=PR(AC13)
W40:W41W40=PR(W21#)
Dynamic array formulas.
Named Ranges
NameRefers ToCells
ar='WM snake diagonal'!$A$1:$T$15AC13, AC10, W21, W18, W10
 
Upvote 0
Few examples before revealing the concept.
SDK array.xlsx
ABCDEFGHIJKLMNOPQRSTUVWX
1extreme sudokus from sudoku.com
2=SK.2IJ(B3:J11)
3755 218284753196
42845396218745
552157496832
671672531984
7814927831649257
8926549827613
9418415962378
1034763185429
118456928374561
12
13 SK.2IJ function solves using recursion and also shows info about recursive loops.
142nd value, total loops, 1st value, nr. of iterations of last loop that solved the puzzle.
15
Sheet3
Cell Formulas
RangeFormula
L2L2=FORMULATEXT(L3)
L3:U11L3=SK.2IJ(B3:J11)
Dynamic array formulas.

SDK array.xlsx
ABCDEFGHIJKLMNOPQRSTUV
15
16=SK.2IJ(B17:J25)
1771654 76427319865
18972915786243
198683452791
20917598261437
21491764835912
223132974586
231429871543629
2425349627158
2553256198374
26
Sheet3
Cell Formulas
RangeFormula
L16L16=FORMULATEXT(L17)
L17:U25L17=SK.2IJ(B17:J25)
Dynamic array formulas.

SDK array.xlsx
ABCDEFGHIJKLMNOPQRSTUV
26
27how many loops for "creating" a solved puzzle from scratch
28=SK.2IJ(B29:J37)
2929 403653849712
30891327645
31274165389
32428736951
33165298473
34937514268
35349651827
36712483596
37586972134
38
Sheet3
Cell Formulas
RangeFormula
L28L28=FORMULATEXT(L29)
L29:U37L29=SK.2IJ(B29:J37)
Dynamic array formulas.
 
A simpler solution, for a single function, but this time with 5x5 of 9x9 arrays on which every row and every column of any next 9x9 array has no dups (SUDOKUs have also every next 3x3 arrays with no dups)
It's iterative, 5 in 5 loops of 3M iterations => total 75M iterations
NK(n,k) delivers kxk of nxn arrays Each nxn array has no dups byrow or bycol
Excel Formula:
=LAMBDA(n, k,
    LET(
        s, SEQUENCE(n),
        q, SEQUENCE(k),
        r, LAMBDA(n, TOROW(SORTBY(s, RANDARRAY(n)))),
        c, LAMBDA(x, AND(BYCOL(x, LAMBDA(y, ROWS(UNIQUE(y)) = ROWS(x))))),
        b, LAMBDA(x,
            REDUCE(
                r(n),
                SEQUENCE(10 ^ 6, 3),
                LAMBDA(v, i, IF(ROWS(v) = x, v, LET(a, VSTACK(v, r(x)), IF(c(a), a, v))))
            )
        ),
        DROP(REDUCE("", q, LAMBDA(v, i, VSTACK(v, DROP(REDUCE("", q, LAMBDA(v, i, HSTACK(v, b(n)))), , 1)))), 1)
    )
)
NNK.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQARASATAU
1
2=NK(9,5)
3618345972179863425312954678672518394346925718
4926851743795148632549378126561273849752849361
5435789621586427391734826951735691482168593247
6361478259627519843267519384189346275289167453
7754192368234795186123497865924835167514782639
8283964517953674218496785213358469721693274185
9179523486341286957875631492296784513937451826
10847236195418352769981263547843127956825316974
11592617834862931574658142739417952638471638592
12539724816462793815786534129495821736857961423
13217835649213956784654192387528764319934156278
14756148923658142937195827436271543698518294637
15971653284574368129427915863736982451179823564
16395287461389517246831759642953417862621437985
17864379152125674398972346518649258173386749152
18628491375741289653368271954182635947742518396
19143562798897431562549683271364179285465372819
20482916537936825471213468795817396524293685741
21857163924697314582371294865945238167735891246
22932846157348796125182675934764915328176534928
23269715483254867913219457386571624983612973485
24624359718921685374924186573183496275398462751
25795432861173249856897362451629843751961248537
26178294635869153247738521649432781596289756314
27581927346782531469645738192817569432453617892
28346581279415972638456913728298357614524189673
29413678592536428791563849217356172849847325169
30592436718214958763374215689546128379856192347
31135648279395482176731596248725681934394586721
32647921853876521349563128974352719846621479538
33876159324453869217297684351861294753435618972
34213584697782613594942863517479832561283754619
35729863145537294681158342796217453698567941283
36354217986148736925815937462683947125178325496
37981375462629175438486759123194365287719263854
38468792531961347852629471835938576412942837165
39159472386532869471647812593286745931347865291
40612345798928514736183295467372469518513689724
41265781943416297385439568271924518673789543612
42371824659379628154528971346153274896874312956
43896253174165973248892137654745186329462157389
44748196235853741692761453982419653287231496578
45523918467794156823214689735638927154958271463
46437569812241385967356724819597831462625938147
47984637521687432519975346128861392745196724835
48
Sheet2
Cell Formulas
RangeFormula
B2B2=FORMULATEXT(B3)
B3:AT47B3=NK(9,5)
Dynamic array formulas.

A lambda that has number of iterations "ni" as separate parameter
(I found the solution with real SUDOKU's far more challenging, this is only if someone prefers a sigle cell formula)
NK(n,k,ni) delivers kxk of nxn arrays using a "k" in "k" loops of "ni"x3 iterations for each loop => k*k*ni*3 iterations. (ni grows "mega" exponential with the size of "n" (for n=5, ni=1000 is enough)
Excel Formula:
=LAMBDA(n, k, ni,
    LET(
        s, SEQUENCE(n),
        q, SEQUENCE(k),
        r, LAMBDA(n, TOROW(SORTBY(s, RANDARRAY(n)))),
        c, LAMBDA(x, AND(BYCOL(x, LAMBDA(y, ROWS(UNIQUE(y)) = ROWS(x))))),
        b, LAMBDA(x,
            REDUCE(
                r(n),
                SEQUENCE(ni, 3),
                LAMBDA(v, i, IF(ROWS(v) = x, v, LET(a, VSTACK(v, r(x)), IF(c(a), a, v))))
            )
        ),
        DROP(
            REDUCE(
                "",
                q,
                LAMBDA(v, i, VSTACK(v, DROP(REDUCE("", q, LAMBDA(v, i, HSTACK(v, b(n)))), , 1)))
            ),
            1
        )
    )
)
Book1
ABCDEFGHIJKLMNOPQRSTUVWXYZAA
1
2=NK(4,3,100)
3341241324321
4213424133412
5124313241234
6432132412143
7432112342314
8341241231423
9123423414132
10214334123241
11132414232431
12324142313124
13413223144312
14241331421243
15
16=NK(5,5,1000)
174231552341324155231424351
182315423415231541324551243
195124331254513422415335124
201453245132452314153212435
213542114523145233542143512
223251443125123451325424315
231534251432541234513212534
242145312543314523254131452
255423135214235145142345123
264312524351452312431553241
272145314235523142143543512
284253123154214353451235124
293521445321431524235114235
301432531542145231524321453
315314252413352415312452341
323125451342214355341234512
331534223154543213524141325
345241342531125432135413254
352453115423352141452352143
364312534215431524213525431
374532125431213455142353124
385241353214541323214541532
391354214325352141523432451
403125442153124534351224315
412413531542435212435115243
42
Sheet1
Cell Formulas
RangeFormula
B2,B16B2=FORMULATEXT(B3)
B3:M14B3=NK(4,3,100)
B17:Z41B17=NK(5,5,1000)
Dynamic array formulas.
Lambda Functions
NameFormula
NK=LAMBDA(n,k,ni,LET(s,SEQUENCE(n),q,SEQUENCE(k),r,LAMBDA(n,TOROW(SORTBY(s,RANDARRAY(n)))),c,LAMBDA(x,AND(BYCOL(x,LAMBDA(y,ROWS(UNIQUE(y))=ROWS(x))))),b,LAMBDA(x,REDUCE(r(n),SEQUENCE(ni,3),LAMBDA(v,i,IF(ROWS(v)=x,v,LET(a,VSTACK(v,r(x)),IF(c(a),a,v)))))),DROP(REDUCE("",q,LAMBDA(v,i,VSTACK(v,DROP(REDUCE("",q,LAMBDA(v,i,HSTACK(v,b(n)))),,1)))),1)))
 
NKni.xlsx
ABCDEFGHIJKLMNO
1
2
3checking: no dups byrow or by col for a single 8x8 array
4
5=NK(8,1,100000)=BYROW(B6#,LAMBDA(x,COUNT(UNIQUE(x,1))))
6714836258
7536784128
8347162588
9852341768
10461257838
11278513648
12625478318
13183625478
14
15=BYCOL(B6#,LAMBDA(x,COUNT(UNIQUE(x))))
1688888888
17
Sheet2
Cell Formulas
RangeFormula
B5,B15,K5B5=FORMULATEXT(B6)
B6:I13B6=NK(8,1,100000)
K6:K13K6=BYROW(B6#,LAMBDA(x,COUNT(UNIQUE(x,1))))
B16:I16B16=BYCOL(B6#,LAMBDA(x,COUNT(UNIQUE(x))))
Dynamic array formulas.
 
This is amazing - a collection of valid Sudoku grids!
Glad you liked it. ✌
Remember we were talking about recursion limitations? Turns out it was some kind of a glitch.
Check this out, made a post about it here:
 
This is amazing - a collection of valid Sudoku grids!
Ref: year 2025 cool formula. Posted a comment 5 days ago, seems that YT deleted it (or can be seen if we choose "Sort by "+"Newest first")
"
Yes, there are a lot of cool facts about this number. (45^2=2025) Another one:
if we write a continuous string, of all numbers from 1 to 45, repeating them by their value, (1 2 2 3 3 3 4 4 4 4…...) will get a huge number that will have …2025 digits.
These are cool facts because they are specific to 2025 only, pattern constructions can be done for any arrays. 😉
Visual proof of all 2025 digits in an array of 45x45 , simplest single formula ever 😊
=--MID(CONCAT(REPT(SEQUENCE(45),SEQUENCE(45))),SEQUENCE(45,45),1) ✌
"
Book1
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQARASATAU
1
2=--MID(CONCAT(REPT(SEQUENCE(45),SEQUENCE(45))),SEQUENCE(45,45),1)
3122333444455555666666777777788888888999999999
4101010101010101010101111111111111111111111121
5212121212121212121212131313131313131313131313
6131414141414141414141414141414151515151515151
7515151515151515161616161616161616161616161616
8161717171717171717171717171717171717181818181
9818181818181818181818181818191919191919191919
10191919191919191919192020202020202020202020202
11020202020202020212121212121212121212121212121
12212121212121222222222222222222222222222222222
13222222222222323232323232323232323232323232323
14232323232323242424242424242424242424242424242
15424242424242424252525252525252525252525252525
16252525252525252525252626262626262626262626262
17626262626262626262626262626272727272727272727
18272727272727272727272727272727272727282828282
19828282828282828282828282828282828282828282828
20282929292929292929292929292929292929292929292
21929292929292929303030303030303030303030303030
22303030303030303030303030303030313131313131313
23131313131313131313131313131313131313131313131
24313232323232323232323232323232323232323232323
25232323232323232323232333333333333333333333333
26333333333333333333333333333333333333333333343
27434343434343434343434343434343434343434343434
28343434343434343434343535353535353535353535353
29535353535353535353535353535353535353535353535
30363636363636363636363636363636363636363636363
31636363636363636363636363636373737373737373737
32373737373737373737373737373737373737373737373
33737373737373838383838383838383838383838383838
34383838383838383838383838383838383838383838393
35939393939393939393939393939393939393939393939
36393939393939393939393939393939404040404040404
37040404040404040404040404040404040404040404040
38404040404040404040404141414141414141414141414
39141414141414141414141414141414141414141414141
40414141414141424242424242424242424242424242424
41242424242424242424242424242424242424242424242
42424242434343434343434343434343434343434343434
43343434343434343434343434343434343434343434343
44434444444444444444444444444444444444444444444
45444444444444444444444444444444444444444444444
46454545454545454545454545454545454545454545454
47545454545454545454545454545454545454545454545
48
Sheet1
Cell Formulas
RangeFormula
B2B2=FORMULATEXT(B3)
B3:AT47B3=--MID(CONCAT(REPT(SEQUENCE(45),SEQUENCE(45))),SEQUENCE(45,45),1)
Dynamic array formulas.
Lambda Functions
NameFormula
ND=LAMBDA(n,LET(r,LAMBDA(SORTBY(SEQUENCE(n),RANDARRAY(n))),a,MOD(SEQUENCE(,n)-SEQUENCE(n),n)+1,INDEX(a,r(),TOROW(r()))))

Fun fact 2: Out of all perfect square years between (1,10000], 2025 is the only year that checks this fact.
Book1
ABCDEFGHIJKL
1perf square
2years btw.
3 1 - 10000
4=LET(y,SEQUENCE(10000),m,MOD(SQRT(y),1)=0,FILTER(y,m))
5↓↓=MAP(B6#,LAMBDA(x,LET(q,SQRT(x),s,SEQUENCE(q),l,LEN(CONCAT(REPT(s,s))),l-x)))
610
74-1
89-3
916-6
1025-10
1136-15
1249-21
1364-28
1481-36
15100-35
16121-34
17144-33
18169-32
19196-31
20225-30
21256-29
22289-28
23324-27
24361-26
25400-25
26441-24
27484-23
28529-22
29576-21
30625-20
31676-19
32729-18
33784-17
34841-16
35900-15
36961-14
371024-13
381089-12
391156-11
401225-10
411296-9
421369-8
431444-7
441521-6
451600-5
461681-4
471764-3
481849-2
491936-1
5020250
5121161
5222092
5323043
5424014
5525005
5626016
5727047
5828098
5929169
60302510
61313611
62324912
63336413
64348114
65360015
66372116
67384417
68396918
69409619
70422520
71435621
72448922
73462423
74476124
75490025
76504126
77518427
78532928
79547629
80562530
81577631
82592932
83608433
84624134
85640035
86656136
87672437
88688938
89705639
90722540
91739641
92756942
93774443
94792144
95810045
96828146
97846447
98864948
99883649
100902550
101921651
102940952
103960453
104980154
10510000155
106
Sheet3
Cell Formulas
RangeFormula
B4B4=FORMULATEXT(B6)
D5D5=FORMULATEXT(D6)
B6:B105B6=LET(y,SEQUENCE(10000),m,MOD(SQRT(y),1)=0,FILTER(y,m))
D6:D105D6=MAP(B6#,LAMBDA(x,LET(q,SQRT(x),s,SEQUENCE(q),l,LEN(CONCAT(REPT(s,s))),l-x)))
Dynamic array formulas.
Lambda Functions
NameFormula
ND=LAMBDA(n,LET(r,LAMBDA(SORTBY(SEQUENCE(n),RANDARRAY(n))),a,MOD(SEQUENCE(,n)-SEQUENCE(n),n)+1,INDEX(a,r(),TOROW(r()))))
 
Also I thought it would be cool to write a random array of 45x45 with numbers that do not repeat byrow/bycol.
Here is a simple lambda that can deliver a random square array of n x n numbers [1-n], that do not repeat byrow/bycol, => no dups byrow nor bycol.
ND( n) No Dups function
Excel Formula:
=LAMBDA(n,
    LET(
        r, LAMBDA(SORTBY(SEQUENCE(n), RANDARRAY(n))),
        a, MOD(SEQUENCE(, n) - SEQUENCE(n), n) + 1,
        INDEX(a, r(), TOROW(r()))
    )
)
Book1
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQARASATAUAVAWAXAYAZBABBBC
1=ND(45)
2323630512144423261910373312743825166945292813433421392233140818241120414217235715
3283226181040192215633442723453421122541252493930173518294236414207163738134331311checking no dups (45 uniques byrow and bycol for each row/col => no dups)
4610424313318424538291122512312443525281932321784013417201427374330391516362192634
5273125457939182114532432622443320111440242383829163417284135313196153637124230210=AND(BYCOL(B2#,LAMBDA(x,ROWS(UNIQUE(x))=45)))
6364034916183273023144173531842292010134333217238254326375441222281524451216391119TRUE
7252923435737161912330412420423118944238222163627143215263933111174133435104028458
8313529411134322251893623026337241558442827124233203821324539717231019404116134614=AND(BYROW(B2#,LAMBDA(x,ROWS(UNIQUE(TOCOL(x)))=45)))
9212519391333121584426372016382714540433418172322310281122352942713459303163624414TRUE
10264520272914384134257181421984031212415444328134369373161023333926351112321752230
11812626333520442403113247325141372730215434191042154392216293945324117183823112836
12131711313840254745361829128301964232352610939241522031427213444537122234328163341
13154419262813374033246174541187393020231443422712335836215922323825341011311642129
14192317374413110136422435181436251233841321615453021826920332740511437282943422392
15333731613154524272011384322853926177101302914443522402334241919251221424318336816
16711525323419431393012236224134536262920433318941144282115283844314016173722102735
17222620402434131694527382117392815641443519183332411291223363043814110313273725425
18414539142123832352819112403613234251518938372274330331421041727332029562611441624
19482222931164043362792034421104233232617145301563811395181225354128371314341972432
20454431825271236393223516444017638291922134241261123473511482131372433910301532028
21263024446838172013431422521433219104533923227372815331627403421218514353611412919
22343832714161252821123953329640271881123130154536234124353421020261322434419437917
23593233032174144372810214452211433424271821311673912406191326364229381415352082533
24202418384523211147432536191537261343942331716131229271021342841612448293053523403
25151913334042276923820311410322184434372812114126174225162923361739324254530183543
26913727343621453413214258426152382831226535201143164410231730401334218193924122937
27242822424636151811229402319413017843137212053526133114253832451016312333493927447
28111592936382325433416271062817440303324873722134518112251932423354420214126143139
29293327291141202316734452824135221336422625104031183619304337515218173839144432412
30374135101719428312415428363294330211114534331833926442738645132329162512227401220
31101482835372214423315269527163392932237636211244174511241831412344319204025133038
32404438132022731342718451139351213324141783736216422923041931626321928452510431523
33232721413535141710128392218402916742453620194342512301324373144915211323383826436
34394337121921630332617441038341145322313167363520541281294082152531182734249421422
35121610303739243644351728117291854131342598382314119213262033434364521224227153240
36384236111820529322516439373310443122121563534194402745283971142430172623238411321
37432411623251034373021314423815436271720114039249453253344126192935223178281311826
38182216364345309125412334171335241123740311514442920725819322639410426272833321381
39172115354244298114402233161234231013639301413432819624718312538394152627232203745
40303428310124221241783512925236231447432726114132193720314438616229183940154533513
41371212830153942352681924320941322225164544291453710384171124344027361213331862331
42443421724261135383122415433916537281821124140251013363445137203036233289291421927
43162014344143287103392132151133229453538291312422718523617302437284042526131193644
44353933815172262922134063430741281991233231161372442253644311212714234445205381018
45421401522249333629202134137143352616191039382384431432431151828342130672712451725
46141812323941265813719301393120743333627111040251632141528223545638223244429173442
47
Sheet2
Cell Formulas
RangeFormula
B1,AV8,AV5B1=FORMULATEXT(B2)
B2:AT46B2=ND(45)
AV6AV6=AND(BYCOL(B2#,LAMBDA(x,ROWS(UNIQUE(x))=45)))
AV9AV9=AND(BYROW(B2#,LAMBDA(x,ROWS(UNIQUE(TOCOL(x)))=45)))
Dynamic array formulas.
Lambda Functions
NameFormula
ND=LAMBDA(n,LET(r,LAMBDA(SORTBY(SEQUENCE(n),RANDARRAY(n))),a,MOD(SEQUENCE(,n)-SEQUENCE(n),n)+1,INDEX(a,r(),TOROW(r()))))
 

Forum statistics

Threads
1,225,492
Messages
6,185,300
Members
453,286
Latest member
JCM

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