Numbers WRAPCOLS: Wrap Lists into Columns and Preserve Record Order
Use Numbers WRAPCOLS with explicit padding, seven-record layouts and a checked column-first round trip that separates records from added cells.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
WRAPCOLS lays out a single row or column of values by filling each output column before moving to the next. With seven records and a wrap count of three, the result has three rows and three columns, including two padded positions.
The count controls values per column. It is not the number of output columns, and wrapping does not sort or combine the records.
Availability and version history
- Introduced: The original introduction release and date are not established by the checked references.
- Availability: Currently documented in Apple’s Functions Help 15.4 documentation edition; no final supported-version endpoint is established.
- Scope: Shared iWork reference. Function-specific historical Mac, iPad, iPhone and iCloud endpoints are unverified.
- Checked: October 14, 2026, against the official WRAPCOLS reference. Examples were independently calculated; no native Numbers test was performed.
Syntax and reading direction
WRAPCOLS(array, wrap-count, pad-with)
Apple’s WRAPCOLS reference requires a one-dimensional array and a wrap count of at least one. pad-with is optional; an omitted pad produces a formula error in an unfilled cell.
For a numeric wrap count of three, the first three values fill the first column from top to bottom. The next three fill the second column, and the seventh starts the third. An explicit "-" uses text padding; quotation marks belong in the formula but are not part of the resulting dash.
Lay out seven identifiers without losing their order
Create ColumnCards, with ten columns A:J and ten rows, including one header row. Put Identifier in A1 and enter R01,R02,R03,R04,R05,R06,R07 in A2:A8 as text.
Put row indices 1,2,3 in D3:D5 and column indices 1,2,3 in E2:G2. In E3 enter:
=INDEX(WRAPCOLS($A$2:$A$8,3,"-"),$D3,E$2)
Fill across through G3, then fill E3:G3 down through row 5. Expect this grid:
| Output row | E | F | G |
|---|---|---|---|
| 3 | R01 | R04 | R07 |
| 4 | R02 | R05 | - |
| 5 | R03 | R06 | - |
Read down E, then down F, then down G to recover the original record order. Reading across row 3 instead gives R01,R04,R07, which is a different sequence.
In I2 enter =INDEX(WRAPCOLS(A2:A8,3,"-"),2,3) for a text dash. In I3 enter =INDEX(WRAPCOLS(A2:A8,3,"-"),3,2) for R06. These position checks distinguish a new padding cell from a genuine record.
For seven records, wrap-count 1 gives one row of seven columns; wrap-count 7 gives one column of seven rows. Apple also states that a count at least as large as the number of input elements produces a single column. The examples do not infer every larger-count padding detail from that statement.
Advanced: recover the original numeric sequence
Create ColumnAmounts, with fourteen columns A:N and twelve rows, including one header row. Put Amount in A1 and enter 12,8,15,20,6,11,18 in A2:A8.
Put row indices 1,2,3 in E3:E5 and column indices 1,2,3 in F2:H2. In F3 enter =INDEX(WRAPCOLS($A$2:$A$8,3,0),$E3,F$2), fill through H3, then down through row 5:
| Output row | F | G | H |
|---|---|---|---|
| 3 | 12 | 20 | 18 |
| 4 | 8 | 6 | 0 |
| 5 | 15 | 11 | 0 |
Enter =SUM(F3:F5) in F7 and fill across through H7 for column totals 35,37,18.
Put positions 1 through 7 in J2:J8. In K2 enter =INDEX(TOCOL($F$3:$H$5,0,TRUE),$J2,1) and fill through K8. In L2 enter =K2-A2 and fill through L8.
K recovers 12,8,15,20,6,11,18, and every L difference is 0. The TRUE argument makes TOCOL scan down columns, matching the original wrapping direction. The full flattened grid has two additional zero pads; the known seven source positions determine where the records end.
In J10 enter =SUM(K2:K8) for 90, and in J11 enter =SUM(F3:H5) for 90. Matching totals do not identify which zeros are padding. Nor do they prove correct ordering: the default row-first TOCOL traversal would begin 12,20,18, rather than 12,8,15.
Keep the original record count or identifiers when a padded layout will later be converted back to a list. A real zero-valued record must not be removed merely because padding also uses zero.
Reproduce Apple’s seven-value example
Create VendorColumns, with eight columns A:H and ten rows, using no header rows. Enter 154,74,365,898,23,576,245 in A1:A7. Put row indices 1,2,3,4 in C2:C5 and column indices 1,2 in D1:E1.
In D2 enter =INDEX(WRAPCOLS($A$1:$A$7,4,"x"),$C2,D$1), fill through E2 and then down through row 5. The expected rows are:
| Output row | D | E |
|---|---|---|
| 2 | 154 | 23 |
| 3 | 74 | 576 |
| 4 | 365 | 245 |
| 5 | 898 | x |
The source example without "x" has a formula error in that final padded position. The exact error token is not specified. This reconstruction preserves all seven actual source values; it does not confuse row labels with part of a number.
Input boundaries and array placement
The input must be one-dimensional: a single row or single column. Apple documents an error for a two-dimensional input and for a wrap count below one. These examples use positive integer counts; fractional-count conversion and extreme array sizes are unverified.
Omitting pad-with produces a formula error in each unfilled position. The checked entry does not name the exact error token. Explicit zero, text padding and omitted padding are different choices; do not assume an omitted pad means zero.
The worksheets use scalar INDEX extraction, whose official reference accepts an array returned by another function. Apple also permits the spilled-range operator #, but these checks do not establish native automatic-spill placement or imported-workbook behavior. Keep the source and the specified output areas separate, and do not extend the extraction beyond the calculated shape.
The original values here contain no source blanks or errors. Their treatment inside an input vector is distinct from the documented behavior of newly padded cells and remains untested. Empty-looking strings and Boolean inputs are also outside these examples.
English examples use comma argument separators. Apple’s functions overview specifies semicolons between arguments when the decimal separator is a comma.
WRAPROWS fills output rows first. SUM checks numeric totals without establishing that a padded layout preserves record identity.