Contact

Numbers TOROW: Flatten Arrays into a Row and Choose Scan Order

Reference Intermediate Apple Numbers

Use Numbers TOROW to create horizontal lists, skip blanks deliberately and compare row-first and column-first sequences with running-total checks.

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

TOROW flattens a rectangular array into one horizontal row. Its default traversal reads each source row in turn. Setting the third argument to TRUE reads each source column in turn while still returning a row.

Use it when the receiving layout needs a horizontal list, but decide the sequence before connecting the result to dates, labels or cumulative calculations.

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

Syntax and the two independent choices

TOROW(array, ignore, scan-by)

Apple’s TOROW entry gives these options:

Argument Meaning and documented default
array The array or reference to flatten.
ignore 0 or omitted keeps all values; 1 skips blanks; 2 skips errors; 3 skips both blanks and errors.
scan-by FALSE or omitted reads each row in turn; TRUE reads each column in turn.

The output’s direction and the input’s scan order are separate choices. Skipping a blank removes a position; keeping it returns zero in Apple’s examples. A genuine numeric zero is not a blank. Formula-generated empty text, whitespace text and imported empty-looking cells are not established as equivalent to genuinely empty cells by the checked entry.

Flatten a two-row set of scheduled slots

Create HorizontalSlots, with ten columns A:J and twelve rows, using no header rows. Enter AM1,AM2,AM3 in B2:D2. Enter PM1 in B3, leave C3 genuinely empty and enter PM3 in D3. These are text codes, not formulas or clock times.

Put the integers 1,2,3,4,5,6 in B5:G5. Label A6 Default order, A7 Column scan, A9 Skip blanks by row and A10 Skip blanks by column.

  • B6: =INDEX(TOROW($B$2:$D$3),1,B$5); fill across through G6.
  • B7: =INDEX(TOROW($B$2:$D$3,0,TRUE),1,B$5); fill across through G7.
  • B9: =INDEX(TOROW($B$2:$D$3,1),1,B$5); fill across through F9 only.
  • B10: =INDEX(TOROW($B$2:$D$3,1,TRUE),1,B$5); fill across through F10 only.
Output row First Second Third Fourth Fifth Sixth
6: default AM1 AM2 AM3 PM1 0 PM3
7: column scan AM1 PM1 AM2 0 AM3 PM3
9: skip by row AM1 AM2 AM3 PM1 PM3 No sixth result
10: skip by column AM1 PM1 AM2 AM3 PM3 No sixth result

Leave G9:G10 empty rather than entering the explanatory text. The zero in the first two outputs represents the empty source slot. It is not a new scheduled record. Removing the slot changes the number of positions, so a separate six-item set of labels would no longer align automatically.

Advanced: traversal changes a running history

Create FlowOrder, with ten columns A:J and twelve rows, using no header rows. Enter 2,4,6 in B2:D2 and 3,5,7 in B3:D3. Put positions 1 through 6 in B5:G5.

In B6 enter =INDEX(TOROW($B$2:$D$3),1,B$5) and fill through G6. In B7 enter =INDEX(TOROW($B$2:$D$3,0,TRUE),1,B$5) and fill through G7.

Now put =SUM($B$6:B6) in B9 and fill through G9. Put =SUM($B$7:B7) in B10 and fill through G10. Each anchored first reference stays fixed while the ending reference moves right.

Position 1 2 3 4 5 6
Row-first values, row 6 2 4 6 3 5 7
Column-first values, row 7 2 3 4 5 6 7
Row-first running sum, row 9 2 6 12 15 20 27
Column-first running sum, row 10 2 5 9 14 20 27

In I6 enter =SUM(B6:G6) and in I7 enter =SUM(B7:G7); both give 27. In I9 enter =G9-G10 for 0. Equal final totals do not prove that intermediate records have the correct order: the second cumulative value is six in one arrangement and five in the other.

The appropriate traversal depends on what the original rows and columns mean. If they encode chronological periods, choose the traversal matching that chronology. TOROW does not interpret the labels or sort events by time. SUM supplies the explicit running checks.

Apple’s full named example

Create VendorRow, with fourteen columns A:N and twelve rows, using no header rows. Enter this grid in A1:D3, leaving B2 and D3 empty:

Row A B C D
1 Aga Danny Fleur Andre
2 Elisha Leave empty Po-Chun Nisha
3 Orkun Jasmine Liz Leave empty

Put positions 1 through 12 in A6:L6. In A7 enter =INDEX(TOROW($A$1:$D$3),1,A$6) and fill through L7. The expected sequence is Aga, Danny, Fleur, Andre, Elisha, 0, Po-Chun, Nisha, Orkun, Jasmine, Liz, 0.

In A9 enter =INDEX(TOROW($A$1:$D$3,1),1,A$6) and fill through J9. It gives the ten names in row-first order. In A10 enter =INDEX(TOROW($A$1:$D$3,1,TRUE),1,A$6) and fill through J10 for Aga, Elisha, Orkun, Danny, Jasmine, Fleur, Po-Chun, Liz, Andre, Nisha. Leave K9:L10 empty.

This reconstructs Apple’s three published formulas and exact source grid through explicit scalar outputs. The empty-slot zeros are documented behavior, not text labels added to the array.

Errors and data selection

Apple documents an error when the array is too large, but this entry does not specify the maximum dimensions or exact error token. Mode 2 removes error values and mode 3 removes both errors and blanks. Removing an error may hide an incomplete record, so inspect the original data before choosing either option.

The examples do not establish what happens to every empty-looking string, imported cell type or malformed mode value. Use the documented 0–3 ignore values and explicit TRUE/FALSE scan options rather than assuming other numeric flags are interchangeable.

Array layout and practical limits

These worksheets use INDEX to extract individual array elements into specified cells. Apple documents INDEX as accepting an array returned by another function. This makes each expected position explicit; it is not an observed automatic-spill demonstration.

The function references also permit the spilled-range operator #. Exact native spill placement, maximum array size, imported-workbook behavior and error tokens have not been measured here. Keep input cells separate from result cells, and do not extend an INDEX formula beyond the expected result dimensions.

English formulas use commas between arguments and decimal points. Apple’s functions overview specifies semicolon argument separators when the decimal separator is a comma. Check the target document’s conventions before copying a formula.

TOCOL makes a column using the same traversal choices. EXPAND enlarges a rectangular array with padding.