Forum Discussion
anupambit1797
May 16, 2023Iron Contributor
How to create a Latin Square in Excel
Dear Experts, Could you please help explain on how can we create a Latin-Square in Excel? An n x n Latin Square is a Latin square consists of sets of the numbers 1 to n arranged ...
- May 17, 2023
Here's my solution. I've attached a sample workbook.
'LatinSquare =LAMBDA(n,MAKEARRAY( n, n, LAMBDA(r, c, LET( seq, SEQUENCE(, n), arr, HSTACK(TAKE(seq, , -(r - 1)), TAKE(seq, , n - (r - 1))), IF(r = 1, c, INDEX(arr, , c)) ) ) ))
Patrick2788
May 17, 2023Silver Contributor
Here's my solution. I've attached a sample workbook.
'LatinSquare
=LAMBDA(n,MAKEARRAY(
n,
n,
LAMBDA(r, c,
LET(
seq, SEQUENCE(, n),
arr, HSTACK(TAKE(seq, , -(r - 1)), TAKE(seq, , n - (r - 1))),
IF(r = 1, c, INDEX(arr, , c))
)
)
))