Contact

Numbers WRAPROWS: Wrap Lists into Rows and Handle Partial Groups

Reference Intermediate Apple Numbers

Build fixed-width Numbers arrays with WRAPROWS, explicit INDEX output cells and practical checks for padding, incomplete groups and changing widths.

Verification status: See the evidence and test scope described in this guide. How formula examples are checked

WRAPROWS places a one-dimensional list into a rectangular array, filling each output row before starting the next. Seven values with a wrap count of three make three rows and three columns; the last two positions need padding.

This is useful for a fixed-width report, but a padded rectangle contains more positions than the original list. That matters when later calculations treat every position as an observation.

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 WRAPROWS reference. Examples were independently calculated; no native Numbers test was performed.

Syntax and the meaning of wrap-count

WRAPROWS(array, wrap-count, pad-with)

The official WRAPROWS entry describes wrap-count as the maximum number of values in each output row. It must be at least one. pad-with fills unoccupied positions and defaults to a formula error.

Use a single input row or column. A wrap count of three makes the output three columns wide in the seven-element examples below. It does not request three output rows; the number of rows follows from the input length.

A complete three-column record layout

Create RowCards, 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.

Enter row indices 1,2,3 in D3:D5 and column indices 1,2,3 in E2:G2. In E3 enter:

=INDEX(WRAPROWS($A$2:$A$8,3,"-"),$D3,E$2)

Fill through G3, then fill E3:G3 down through row 5. Expect:

Output row E F G
3 R01 R02 R03
4 R04 R05 R06
5 R07 - -

In I2 enter =INDEX(WRAPROWS(A2:A8,3,"-"),3,2) for a text dash. In I3 enter =INDEX(WRAPROWS(A2:A8,3,"-"),2,3) for R06. The two dashes are presentation markers, not extra records.

A wrap count of one gives one value per row, so the seven values form one column. A count of seven gives a single row of seven values. Apple also describes counts at least as large as the input length as returning a single row; larger-count padding details are not tested here.

Advanced: a short final row is not three observations

Create BatchDurations, with fourteen columns A:N and twelve rows, including one header row. Put Minutes 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(WRAPROWS($A$2:$A$8,3,0),$E3,F$2), fill through H3 and then down through row 5.

The output rows are 12,8,15, 20,6,11 and 18,0,0. In I2:L2 write Total minutes, Original records, Mean per record and Mean of padded row. Enter the known original record counts 3,3,1 in J3:J5.

  • I3: =SUM(F3:H3); fill through I5.
  • K3: =I3/J3; fill through K5.
  • L3: =AVERAGE(F3:H3); fill through L5.
Row I: total J: original records K: mean per record L: padded-row mean
3 35 3 11.6666666667 11.6666666667
4 37 3 12.3333333333 12.3333333333
5 18 1 18 6

Decimal means are rounded here to ten places. The last padded row contains three numbers, but only one original observation. Its naive average is 18/3=6, while that record’s duration is eighteen minutes. A zero pad is not evidence of two instantaneous tasks.

Enter =SUM(I3:I5) in I8 for 90, =SUM(J3:J5) in J8 for 7, and =I8/J8 in K8 for approximately 12.8571428571 minutes per original record. In L8 enter =AVERAGE(F3:H5) for 10, the average over all nine padded positions.

The counts in J come from the known seven-record input and grouping. Counting nonzero results is not a general replacement because genuine zero-duration records could exist. SUM and AVERAGE need a clearly defined denominator.

Change the width without changing the underlying list

Create FourWide, with fourteen columns A:N and twelve rows, including one header row. Copy the original Minutes inputs into A1:A8. Put row indices 1,2 in E3:E4 and column indices 1,2,3,4 in F2:I2.

In F3 enter =INDEX(WRAPROWS($A$2:$A$8,4,0),$E3,F$2), fill through I3 and then down through row 4. Expect 12,8,15,20 and 6,11,18,0.

Enter =SUM(F3:I3) in K3 and fill through K4 for 55,35. Put the original record counts 4,3 in L3:L4, then M3 =K3/L3 filled through M4 for 13.75 and approximately 11.6666666667. In K6 enter =SUM(K3:K4) for 90.

The same list has different row groups, so row totals and means change. This is a layout rule, not a discovery of natural categories in the records. Preserve meaningful group identifiers instead of allowing a report width to redefine them accidentally.

Reconstruct the official example

Create VendorRows, with ten columns A:J and ten rows, using no header rows. Enter 154,74,365,898,23,576,245 in A1:A7. Put row indices 1,2 in C2:C3 and column indices 1,2,3,4 in D1:G1.

In D2 enter =INDEX(WRAPROWS($A$1:$A$7,4,"x"),$C2,D$1), fill through G2 and then down through row 3. Expect rows 154,74,365,898 and 23,576,245,x. This matches Apple’s seven-value illustration with an explicit text pad.

With padding omitted, the unfilled fourth position in that final row returns a formula error. It does not supply zero automatically. The source does not state the exact error token.

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.

WRAPCOLS fills columns first. TOROW can flatten the rectangular output again, but the retained input length is needed to distinguish any trailing pads from original records.