I’m trying to
- expand a column with MAKEARRAY, using instances to determine number of rows that should be populated with a value and then
- using REDUCE to VSTACK multiple of these arrays together
I seem to be having trouble accessing the corresponding index of instances to be able to determine the size of the MAKEARRAY for each, and seems to be using the number of elements instead of the value of each index.
=LET(
instances,B2:B4,
letters,A2:A4,
DROP(REDUCE("",letters,LAMBDA(acc,curr,VSTACK(acc,
MAKEARRAY(1+instances,1,LAMBDA(r,c,curr))))),1))
Edit: Note that I’m specifically trying to avoid the character limit of TEXTJOIN, so if used as an outer function, it would be an issue.
2
The formula in K8:
=TEXTSPLIT(TEXTJOIN("|",TRUE,REPT(K1:K3&"|",L1:L3+1)),,"|",TRUE)
With the original ranges
=TEXTSPLIT(TEXTJOIN("|",TRUE,REPT(A2:A4&"|",B2:B4+1)),,"|",TRUE)
1