

May 19, 2022

I can use WRAPCOLS for a single column, just want to know does it work for 2 Columns; I have 20 pages of
Account No Bonus
123456 500.00
234567 1500.00
I have room on the excel sheet for 3 sets of these rather than 20 pages of one set. I am currently copying to Excel & getting it done this way, just wondering if WRAPCOLS works for 2 or more cols?


July 16, 2010

Hi Eileen,
The best solution I could come up with is to use TEXTJOIN in column C to concatenate the Account No. and Value together with a space:
=TEXTJOIN(" ",TRUE,A2:B2)
Or just use the ampersand like so:
=A2&" "&B2
Then copy down the column.
Then in cell E2 use WRAPROWS like so:
=WRAPROWS(C2:C507,5)
I don't think there's a way with formulas to interweave columns A and B across multiple columns, but someone cleverer than me might have some other ideas!
Mynda

Answers Post


Trusted Members
Moderators

November 1, 2018

I feel like there should be something simpler using HSTACK and WRAPCOLS but it eludes me at the moment. Something like this should work - adjust the 50 to however many rows you can fit on a printed page:
=LET(numRows,50,data,A2:B507,MAKEARRAY(numRows,2*ROUNDUP(ROWS(data)/numRows,0),LAMBDA(r,c,IFERROR(INDEX(data,INT((c-1)/2)*numRows+r,1+ISEVEN(c)),""))))


Trusted Members
Moderators

November 1, 2018

Not simpler, but just as an option:
=LET(data,A2:B507,numrows,50,numcols,ROUNDUP(ROWS(data)/numrows,0),CHOOSECOLS(HSTACK(WRAPCOLS(INDEX(data,,1),numrows,""),WRAPCOLS(INDEX(data,,2),numrows,"")),SCAN(numcols,SEQUENCE(numcols*2),LAMBDA(a,b,IF(ISEVEN(b),a+numcols,a-numcols + 1)))))
1 Guest(s)
