Array

WRAPROWS Formula

Wraps a single-row or single-column vector into a two-dimensional array by filling rows from left to right, then moving to the next row. Use WRAPROWS to reformat a flat data stream into a tabular layout with a fixed number of columns per row.

Syntax

WRAPROWS(vector, wrap_count, [pad_with])
ParameterDescription
vector Parameter of the WRAPROWS function.
wrap_count Parameter of the WRAPROWS function.
[pad_with] (Optional.) Parameter of the WRAPROWS function.
Try WRAPROWS in Viztab — free, no signup

Examples

12 months into 4 columns

Formula
=WRAPROWS(A1:L1, 4)
Wraps 12 values into 3 rows of 4 columns each. Row 1: Jan-Apr, Row 2: May-Aug, Row 3: Sep-Dec.

Name badges layout

Formula
=WRAPROWS(A1:A24, 3)
Arranges 24 names into an 8-row by 3-column grid, perfect for printing name badges or labels.

Pad with blanks

Formula
=WRAPROWS(A1:A7, 3, "")
7 values wrapped into rows of 3: two full rows (6 values) plus a third row with 1 value and 2 empty cells.

Common Errors

#VALUE!

The wrap_count is zero, negative, or non-numeric, or the input is not a vector.

#SPILL!

The output cells are not all empty.

Tips

Set columns per row

The wrap_count parameter is the number of columns (items per row), not the number of rows. WRAPROWS figures out how many rows are needed automatically.

Print-friendly layouts

Use WRAPROWS to convert long lists into multi-column layouts that make better use of page width when printing.

Opposite of TOCOL/TOROW

WRAPROWS and WRAPCOLS are the inverse of TOROW and TOCOL. You can flatten with TOCOL, process the data, then reshape with WRAPROWS.

Try WRAPROWS in Viztab

Import your data and use WRAPROWS with 370+ other formulas. No signup required.

Open Viztab

Related Formulas