Forum Discussion
How to wrap table, not vector (WRAPCOLS for tables)
- Jul 17, 2026
My approach is to leave the table as a 2D array and pull out what's needed in blocks.
=WrapRows2Dλ(DROP(Snapλ(T_Data,"Biology"),,1),4,"")Snapλ is a convenience Lambda for quick filtering without having to supply a Boolean vector.
WrapRows2Dλ has three arguments - array, new_height (4 for this example), and an optional pad_width (empty string here).
WrapRows2Dλ / WrapCols2Dλ: Fast, efficient 2D wrapping without flattening | Microsoft Community Hub
=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.