WRAPROWS Function

Excel 365, Excel 2021

Summary

The WRAPROWS function transforms a linear array or vector into a multi-row 2D array by wrapping elements into rows of specified length. Perfect for reshaping data into matrices or creating organized table structures from single columns or rows.

Syntax

WRAPROWS(vector, wrap_count, [pad_with])

Parameters

Parameter Type Required Description
vector Array/Reference Yes One-dimensional array or range containing values to wrap
wrap_count Number Yes Number of values per row (must be 1 or greater)
pad_with Any No Padding value for incomplete final row (optional, defaults to #N/A)

Using the WRAPROWS Function

WRAPROWS is invaluable for data analysts who need to restructure linear datasets into tabular formats. Use it to convert long lists into matrices, create custom table layouts, or prepare data for visualization and reporting.

Common WRAPROWS Examples

Basic Row Wrapping

=WRAPROWS(A1:A7,3)

Converts 7 values in column A into 3 rows of 3 columns each, with #N/A in the last position.

Custom Padding

=WRAPROWS(A1:G1,3,"-")

Wraps horizontal data A1:G1 into 3-column rows, padding incomplete row with dashes instead of #N/A.

Complete Matrix

=WRAPROWS(SEQUENCE(12),4)

Creates a perfect 3x4 matrix from sequential numbers using the SEQUENCE function.

Frequently Asked Questions

The function returns your data as a single row spanning all elements.

Yes, it works with both horizontal and vertical one-dimensional arrays.

WRAPROWS creates rows (horizontal wrapping), WRAPCOLS creates columns (vertical wrapping).

Common Errors and Solutions

#VALUE!

Cause: Vector argument is not a one-dimensional array

Solution: Ensure input is a single row or single column reference

#NUM!

Cause: wrap_count is less than 1

Solution: Use a positive integer ≥1 for wrap_count

#N/A in results

Cause: Normal behavior for unfilled positions in incomplete rows

Solution: Use pad_with parameter to replace with custom value

Notes

  • Requires Excel 365 or Excel 2021
  • Input must be strictly 1D (single row or single column)
  • Output is a dynamic array that spills automatically
  • pad_with defaults to #N/A if omitted
  • Very efficient for large datasets

Compatibility

Available in: Excel 365, Excel 2021

Not available in: Excel 2019, Excel 2016, Excel 2013, Excel 2010, Excel 2007

Content last reviewed: December 9, 2025
Update frequency: As needed
Excel versions tested: Excel 365, Excel 2021