Forum Discussion
ElRafaVaz33
May 20, 2022Copper Contributor
Creating a dynamic repeating sequence of arrays
Hi Excel community, I'm trying to find a way to create a dynamic array of repeating cells. I was attempting a similar technique on Google Sheets where you can use a Rept and TextJoin to create a ...
- May 20, 2022
ElRafaVaz33 There are lots of possibilities. Here is one:
=LET(in,F1:F6,rep,G1,s,SEQUENCE(ROWS(in)*rep,1,0),INDEX(in,QUOTIENT(s,rep)+1))
Patrick2788
Jul 09, 2024Silver Contributor
A recursive solution with an option for directional output vertical or horizontal.
RepeatElements = LAMBDA(arr, reps, [direction],
LET(
vector, IF(ISOMITTED(direction), TOCOL(arr), TOROW(arr)),
acc, TAKE(arr, , 1),
stack, HSTACK(acc, arr),
IF(reps = 1, vector, RepeatElements(stack, reps - 1, direction))
)
)