This function transforms an array or range of cells into a single row. TOROW can scan values:

  • By column, top to bottom
  • By row, left to right

The scan_by_column argument is a boolean value that controls how TOROW reads values from the source array.

Sample Usage

TOROW(A1:C3): A TOROW function that keeps all values and scans by row.

TOROW(A1:C3, 1, TRUE): A TOROW function that ignores blanks and scans by column.

Syntax

TOROW(array_or_range, [ignore], [scan_by_column])

  • array_or_range: The array or range of cells to return as a row.
  • [ignore]: By default, no values are ignored. Specify one of these values:
    • 0: Keep all values
    • 1: Ignore blanks
    • 2: Ignore errors
    • 3: Ignore blanks and errors
  • [scan_by_column]: The boolean value of scan_by_column determines how the array is scanned. By default, the TOROW function scans the array by row.
    • True: scans the array by column
    • False: scans the array by row

Examples

Use simple data transformation operation with TOROW

Example data:

ABC
1BenPeterMary
2JohnHillaryJenny
3AgnesHarryFelicity

Example: Input this formula in E1: =TOROW(A1:C3)

Result:

EFGHIJKLM
1BenPeterMaryJohnHillaryJennyAgnesHarryFelicity

Make a Copy

Ignore blanks with TOROW

Example data:

ABC
1BenPeterMary
2JohnJenny
3AgnesHarryFelicity

Example: Input this formula in E1: =TOROW(A1:C3, 1)

Result:

EFGHIJKL
1BenPeterMaryJohnJennyAgnesHarryFelicity

Make a Copy

Scan by column with TOROW

Example data:

ABC
1BenPeterMary
2JohnHillaryJenny
3AgnesHarryFelicity

Example: Input this formula in E1: =TOROW(A1:C3, 0, TRUE)

Result:

EFGHIJKLM
1BenJohnAgnesPeterHillaryHarryMaryJennyFelicity

Make a Copy

  • TOCOL: This function transforms an array or range of cells into a single column.