Restructuring raw data arrays, calendar schedules, and product catalogues in Microsoft Excel often requires transforming a continuous one-dimensional list of values into a structured multi-column or multi-row matrix. Historically, achieving this transformation required complex array math combining INDEX, SEQUENCE, ROUNDUP, and MOD. Modern versions of Microsoft Excel introduce two intuitive dynamic array functions designed specifically for dimensional transformations: WRAPROWS and WRAPCOLS. These native functions allow users to reshape flat vectors into two-dimensional grids with minimal syntax.
Understanding WRAPROWS vs WRAPCOLS
- WRAPROWS: Wraps a one-dimensional array horizontally into rows after reaching a specified number of elements. The array fills left-to-right before wrapping down to the next row.
- WRAPCOLS: Wraps a one-dimensional array vertically into columns after reaching a specified number of elements. The array fills top-to-bottom before wrapping across to the next column.
Syntax and Parameters
WRAPROWS Syntax
=WRAPROWS(vector, wrap_count, [pad_with])
vector:The 1D range or dynamic array of items to reshape (e.g.,A2:A25).wrap_count:The maximum number of values in each row before wrapping down.pad_with:Optional. The value used to populate missing cells if the vector cannot divide evenly into the grid (defaults to#N/A).
WRAPCOLS Syntax
=WRAPCOLS(vector, wrap_count, [pad_with])
vector:The 1D range or dynamic array of items to reshape.wrap_count:The maximum number of values in each column before wrapping to the next column.pad_with:Optional value to populate empty cells in an uneven final column.
Practical Example 1: Reshaping a Flat List into a 3-Column Table with WRAPROWS
Suppose an inventory export outputs items sequentially in a single column A2:A13 where records follow a repeating pattern of SKU, Product Name, Price:
=WRAPROWS(A2:A13, 3)
The formula creates a structured 4-row by 3-column table:
- Row 1 contains items 1, 2, 3 (SKU, Name, Price).
- Row 2 contains items 4, 5, 6.
- Row 3 contains items 7, 8, 9.
- Row 4 contains items 10, 11, 12.
Practical Example 2: Building a Monthly Calendar Grid with WRAPROWS
Generating an interactive monthly calendar layout often begins with a sequence of 35 or 42 days (7 days per week):
=WRAPROWS(SEQUENCE(35, 1, DATE(2026, 11, 1), 1), 7)
SEQUENCE generates 35 consecutive date integers, and WRAPROWS(..., 7) wraps the dates into a 5-week by 7-day grid corresponding to Monday through Sunday columns.
Practical Example 3: Organizing Shift Rosters Vertically with WRAPCOLS
Suppose you have a roster list of 16 staff members in B2:B17 that must be organized into 4 daily work shifts of 4 team members each:
=WRAPCOLS(B2:B17, 4)
WRAPCOLS fills the first column with members 1 through 4, the second column with members 5 through 8, the third column with members 9 through 12, and the fourth column with members 13 through 16.
Handling Uneven Datasets with pad_with
If your source vector does not divide evenly by the wrap_count (for example, wrapping 10 items into rows of 3), the trailing unfilled cells will evaluate to #N/A. To avoid unsightly errors, specify a replacement placeholder:
=WRAPROWS(A2:A11, 3, "-")
Row 4 will contain items 10 and 11, with the final third cell displaying a clean hyphen (-) instead of #N/A.
Combining WRAP Functions with Other Dynamic Arrays
- Unflattening Before Sorting: Combine
WRAPROWSwithSORTorFILTERto organize raw scraped data before calculating summary totals. - Pair with TOCOL: You can invert the process at any time: passing a 2D grid into
TOCOL(range)flattens the matrix back into a single vertical vector.