WRAPROWS function
WRAPROWS reshapes a single row or column into a multi-row array of a fixed width, filling left to right and then down. A short last row is padded with #N/A.
Example
Read it as a sentence: wrap the list 1 to 6 into rows of 3, then take the value in row 2, column 1, which gives 4.
Syntax
WRAPROWS(vector, wrap_count, [pad_with])
Arguments in [square brackets] are optional.
-
vector(required) - A single row or column to reshape.
-
wrap_count(required) - Maximum items per row.
-
pad_with(optional) - Fill for leftover cells; default #N/A.
Returns: A multi-row array filled across each row.
One WRAPROWS formula can fill more than one cell. When the result has several values, they spill into the cells below or to the right of the formula.
What Excel actually returns
Each formula below was run in desktop Excel. The result is exactly what the cell showed, errors included.
| Formula | Excel shows | Case |
|---|---|---|
=WRAPROWS({1,2,3,4,5},2) | 1 | Default pad |
=WRAPROWS({1,2,3,4,5},2,"") | 1 | Pad empty text |
=WRAPROWS({1,2,3},1.5) | 1 | Fractional wrap |
=WRAPROWS({1,2;3,4},2) | #VALUE! | 2D input |
=WRAPROWS({1,2,3},0) | #NUM! | Wrap 0 |
Watch out for
- Input must be one row or one column.
- Short last row is padded with #N/A.
Where it works
- Excel
- WRAPROWS arrived in Excel 2024. Older versions do not have it. 365, Excel for the web and Excel 2024; not in older perpetual versions.
- Google Sheets
- Same name, same behaviour for everyday use.
Part of Lookup and reference functions. Every result on this page was measured in desktop Excel, build 16.0.20527. Last updated .