Syntax
=WRAPCOLS(vector, wrap_count, [pad_with])Arguments
| Argument | Required | Description |
|---|---|---|
vector | Required | A single row or column |
wrap_count | Required | Values per column |
pad_with | Optional | The value for leftover cells (default #N/A) |
How to use WRAPCOLS
When WRAPCOLS returns more than one value, the result spills into the cells below and to the right. Keep those cells empty, or you get #SPILL!.
WRAPCOLS takes 2 required arguments and 1 optional argument. Type =WRAPCOLS( in a cell and SheetsBat shows the arguments as you go. Optional arguments are shown in square brackets; leave them out to use their default.
Examples
Each result below was calculated by the SheetsBat formula engine.
=WRAPCOLS({1,2,3,4}, 2)Result Spilled result
| A | B | |
|---|---|---|
| 1 | 1 | 3 |
| 2 | 2 | 4 |
=WRAPCOLS({1,2,3}, 2)Result Spilled result
| A | B | |
|---|---|---|
| 1 | 1 | 3 |
| 2 | 2 | #N/A |
Related array functions
- SORTBYSorts a range or array by the values of other ranges or arrays.
- SORTNReturns the first n rows of a range after sorting, with options for ties.
- TAKEReturns a number of rows or columns from the start (positive) or end (negative) of an array.
- TOCOLReturns the values of an array as a single column.
- TOROWReturns the values of an array as a single row.
- TRIMRANGERemoves empty rows and columns from the edges of a range.
- UNIQUEReturns the unique rows (or columns) of a range or array.
- VSTACKStacks arrays on top of each other; shorter rows are padded with #N/A.
- WRAPROWSWraps a row or column of values into rows of the given length.