Excel functions / Dynamic arrays
WRAPROWS function
Wraps a row or column of values into rows of a set length.
Syntax
=WRAPROWS(vector, wrap_count, [pad_with])
Arguments
vector: A single row or column of values.wrap_count: How many values in each row.pad_with(optional): What fills the last row if it comes up short (default #N/A).
When to use it
WRAPROWS turns a single row or column into a grid, filling a row at a time with a set number of values. It lays out a long list in columns that fit a page, or regroups data that came out as one long list.
Examples
Six items, three to a row
A B C D E 1 Item Pen Stapler Folder 2 Pen Tape Glue Ruler 3 Stapler 4 Folder 5 Tape 6 Glue 7 Ruler In C1:
=WRAPROWS(A2:A7, 3)→ Pen, Stapler, Folder; Tape, Glue, RulerUneven: the gap filled with a dash
A B C D E 1 Item Pen Stapler Folder 2 Pen Tape Glue - 3 Stapler 4 Folder 5 Tape 6 Glue 7 Ruler In C1:
=WRAPROWS(A2:A6, 3, "-")→ Pen, Stapler, Folder; Tape, Glue, -
Common mistakes
- A grid as the source. WRAPROWS takes one row or column. Flatten a grid first with TOCOL.
WRAPROWS in other languages
Excel shows function names in its own language. In these languages it also puts a semicolon between arguments where English has a comma.
Try WRAPROWS in the playground