Data exports from database logs, web scraping tools, or form responses often output continuous, single-column streams of values where records repeat sequentially (for example: Name, Email, Department, Name, Email, Department). Reformatting these vertical lists into structured, multi-column tables historically required complicated index arithmetic. In Google Sheets, the native WRAPROWS and WRAPCOLS functions transform single-dimensional arrays into structured two-dimensional grids with a single formula.
Understanding the Syntax of WRAPROWS and WRAPCOLS
Both functions accept a source vector and split it based on your defined wrap count:
=WRAPROWS(range, wrap_count, [pad_with]): Wraps the provided row or column of values by rows after reaching a specified number of elements to form a new two-dimensional array.=WRAPCOLS(range, wrap_count, [pad_with]): Wraps the provided values by columns after reaching a specified number of elements.[pad_with]: An optional value used to fill empty cells if the total number of items in your source range does not divide evenly by the wrap count (defaults to#N/Aif omitted).
Transforming a Single Column into a Multi-Column Table with WRAPROWS
Suppose you have a vertical list in cells A1:A30 where every three rows represent a complete customer record (Name, Phone, City). To convert this into a 3-column table:
- Click on the cell where you want your new table to begin (e.g.,
C1). - Enter the formula:
=WRAPROWS(A1:A30, 3, "") - Press Enter. Google Sheets automatically spills the values into 3 columns across 10 rows. Supplying
""as thepad_withargument ensures that any trailing missing values display as clean blank cells rather than error codes.
Building Calendar Grids or Column Layouts with WRAPCOLS
When you want sequential data to flow downward through columns before spilling into the next column (such as building vertical shift schedules or column-centric planners):
- Down-and-Across Spilling:
=WRAPCOLS(A1:A28, 7, "-")
This creates columns that are each 7 rows high, perfectly segmenting days into weekly vertical blocks. - Dynamic Combination with FILTER or UNIQUE: You can nest dynamic array outputs directly inside
WRAPROWS:=WRAPROWS(UNIQUE(FILTER(A2:A, A2:A<>"")), 4, "N/A")
Mastering WRAPROWS and WRAPCOLS in Google Sheets eliminates hours of manual data reformatting, enabling you to build responsive, dynamically restructuring dashboards with ease.