Excel TOROW function


The Excel TOROW function is used to transform an array or range into a single row. This function can scan values by row (default) or by column, and offers options to ignore blanks and errors. TOROW is useful for converting data from a two-dimensional format into a linear row format, which can be essential for specific types of data analyses or presentations.
					=TOROW(array, [ignore], [scan_by_column])
  • array: The array or range to transform
  • [ignore]: [Optional] Setting to control whether to ignore blanks and/or errors. Use 0 to keep all values (default), 1 to ignore blanks, 2 to ignore errors, and 3 to ignore both blanks and errors
  • [scan_by_column]: [Optional] Boolean value to control scanning order. TRUE to scan by column, FALSE to scan by row (default)
Return value
A single row of values from the transformed array.

How to use

Use TOROW by specifying the array to transform. Optionally, set the ignore parameter to control whether to skip blanks or errors, and set the scan_by_column parameter to control the order in which values are read from the array.


Simple TOROW
Transforming a 2D Array into a Single Row: To convert a two-dimensional range into a single row:
This formula transforms the 2D array in B2:D4 into a single row, scanning row by row from left to right.
TOROW with Ignored Blanks
Ignoring Blanks in Array Transformation: To transform an array into a row while ignoring blank cells:
					=TOROW(B2:D4, 1)
This formula converts B2:D4 into a single row and skips any blank cells in the range.
TOROW with Scanning by Column
Scanning Values by Column in Transformation: To read values from an array by column instead of by row:
					=TOROW(B2:D4, 0, TRUE)
By setting scan_by_column to TRUE, this formula reads values top to bottom in each column of B2:D4, then moves to the next column.
TOROW with Ignored Errors
Excluding Errors from Transformed Array: To exclude error values when transforming a range:
					=TOROW(B2:D4, 2)
This transforms B2:D4 into a single row, ignoring any cells that contain errors.
Advanced TOROW for Data Processing
Complex Data Transformation with TOROW: To transform a range into a single row, ignoring both blanks and errors:
					=TOROW(B2:D4, 3)
This formula converts the range B2:D4 into a single row while ignoring both blank cells and error values.

Additional Notes

  • TOROW is particularly useful when you need to process or analyze data in a linear format.
  • The function’s ability to ignore blanks and errors makes it versatile for handling real-world data scenarios.
  • TOROW, combined with other array functions, can significantly streamline data manipulation tasks.

Related Functions

Excel WRAPROWS function

The Excel WRAPROWS function transforms a linear array into a two-dimensional format by wrapping values into rows, useful for structured data presentation.

Excel WRAPCOLS function

The Excel WRAPCOLS function restructures a linear array into a two-dimensional format by wrapping values into columns, enhancing data presentation.

Excel TOROW function

The Excel TOROW function transforms an array into a single row, with flexibility in scanning and options to omit blanks and errors.

Content Navigation