Solved Extract a list of values into evenly distributed groups

Nick Burns

Member
Joined
May 24, 2017
Messages
164
Reaction score
0
Points
16
Excel Version(s)
Office 365
I'm trying to evenly distribute CSV list into groups of 10. (in a sense, "word wrap" the list

I was able to get them evenly distributed, but, in addition I want to give each item an index. I came close, but each distribution restarted at 1. I'd also like to eliminate any items that would be blank and eliminate the final ",". See the image for my tests.
Here's the list of numbers
005,015,023,024,031,033,037,038,045,046,049,051,053,056,059,060,061,062,063,066,068,071,075,076,077,080,083,086,091,092,096,101,102,106,110,111,112
Here are the formulas I used:
=BYROW(WRAPROWS(TEXTSPLIT(A1, ","), 10, ""), LAMBDA(row, TEXTJOIN(",", TRUE, row) & ","))
=BYROW(WRAPROWS(TEXTSPLIT(A1, ","), 10, ""), LAMBDA(row, TEXTJOIN(",", TRUE, SEQUENCE(ROWS(row),COLUMNS(row)) & "=" & row)& ","))

1746124712065.png

Thanks for any help
 
Try this:

Code:
=LET(t,TEXTSPLIT(A1,","),
s,SEQUENCE(,COLUMNS(t))&"=",
w,WRAPROWS(s&t,10,""),
BYROW(w,LAMBDA(r,TEXTJOIN(",",,r))))
 
Back
Top