Forum Discussion
Zdenek_Moravec
Jan 21, 2024Brass Contributor
How to wrap table, not vector (WRAPCOLS for tables)
Dear colleagues I have a long table of 5 columns and maybe 200 rows. The task is to wrap the table after a specified number of rows to see the table in landscape on a new sheet. I was thinking abo...
OliverScheurich
Jan 21, 2024Gold Contributor
=LET(filtered,DROP(FILTER(A2:F21,A2:A21=I1),,1),
IFNA(
DROP(
REDUCE("",SEQUENCE(ROUNDUP(ROWS(filtered)/J1,0),1,1,J1),
LAMBDA(u,v,
HSTACK(u,
IF(MAX(ROWS(filtered))-v>=J1,
CHOOSEROWS(filtered,SEQUENCE(J1,1,v,1)),
CHOOSEROWS(filtered,SEQUENCE(MAX(ROWS(filtered))-v+1,1,v,1))))))
,,1),
"")
)
You can apply this formula. In my example the subject is selected in cell I1. The number of rows is specified in cell J1.