The TOROW function in Google Sheets is a powerful tool that enables users to convert a range or an array of data into a single horizontal row. This function is particularly useful when wanting to simplify data presentation and facilitate easier analysis.
Syntax
TOROW(array, [property])
- array: The range of cells or array that you want to convert into a row.
- property: (Optional) A boolean that indicates whether to ignore empty cells. Default is FALSE.
Example #1
=TOROW(A1:B3)
This function will take the values in the range A1 to B3 and arrange them in a single row. For instance, if A1 is 1, A2 is 2, and B1 is 3, the result would be:
1, 2, 3.
Example #2
=TOROW(A1:B3, TRUE)
This version will also convert the same range to a single row, but it will ignore any empty cells in the range. If A1 is 1, B1 is 3, and A2 is blank, the outcome will be:
1, 3.
Example #3
=TOROW({1, 2, ; 3, 4})
Using a direct array input, this function will create a row from the provided array. For this specific array, the result would be:
1, 2, 3, 4.
Error handling
- REF! – This error occurs when the specified range is invalid or no longer exists.
- VALUE! – This indicates that the function is trying to process data types that are not compatible, such as a non-array value.
- N/A – This error signifies an attempt to reference a cell that is empty or does not contain any data.