Wrap array into columns
=WRAPCOLS(vector, wrap_count, [pad_with])
| Parameter | Description |
|---|---|
vector |
The array or range to wrap. |
wrap_count |
Max values in each column. |
pad_with |
[optional] Value to use for unfilled places. |
WRAPCOLS outputs values "by column", working top to bottom, left to right. When wrap_count has been reached, WRAPCOLS starts a new column. In the work
=WRAPCOLS(C2:J2,4)
Wrap_count represents the maximum number of values in each column. Once the count has been reached, WRAPCOLS starts a new column. In the screen below,
=WRAPCOLS(B3:B14,4)
The formula in D10 uses a wrap_count of 4:
=WRAPCOLS(B3:B14,3)
If no value is supplied for pad_with, WRAPCOLS will return an #N/A error after all values in the source array have been accounted for. You will see th
=WRAPCOLS(B3:B12,4)
The input range contains only 10 cells, which is not evenly divisible by a wrap_count of 4. As a result, the last 2 cells return #N/A. The formula in
=WRAPCOLS(B3:B12,4,"x")