TOROW function
Quick answer
TOROW turns a range or array into a single row, reading across each row unless you ask for column by column.
- Syntax
=TOROW(array, [ignore], [scan_by_column])- Most common use
=TOROW(A2:A4)returns Ana (The names across a row)
Like TOCOL, it can skip blanks and errors. Use it to lay a list out across a header row, or to feed a whole grid into a function that wants one row of values.
- Available in
- Excel 2024 and Microsoft 365
- Category
- Dynamic array functions
- Returns
- A one-row array that spills to the right.
- Google Sheets
- Available in Google Sheets.
Syntax
=TOROW(array, [ignore], [scan_by_column])
| Argument | Required? | What it is |
|---|---|---|
array | Required | The range or array to flatten. |
ignore | Optional | Optional: 0 keeps everything (default), 1 skips blanks, 2 skips errors, 3 skips both. |
scan_by_column | Optional | Optional: TRUE reads down each column first; FALSE (default) reads across each row. |
Examples
Each result below is calculated from the sample sheet by our formula engine, the same one that grades the practice.
| Cell | Formula | Result | What it shows |
|---|---|---|---|
| D2 | =TOROW(A2:A4) | Anaspills 1 × 3 | The names across a row |
| D3 | =TOROW(B2:B4,1) | 88spills 1 × 2 | The scores, with the blank skipped |
| D4 | =COLUMNS(TOROW(A2:B4,1)) | 5 | 5 values once the blank is left out |
Try it live
This is the sample sheet. Change any number or text, or edit a formula, and the results update.
Show the sample data as a table
| Name | Score | ||||
| Ana | 88 | Ana | Raj | Lee | |
| Raj | 92 | 88 | 92 | ||
| Lee | 5 |
Practice TOROW
Graded instantly, then re-checked on changed data.
Names across a row
C1, lay out the names in A2:A6 across row 1, starting in C1.Common mistakes
| What you see | Why, and how to fix it |
|---|---|
| #SPILL! | The cells to the right aren't empty. |
| Zeros where blanks were | Blank cells come through as 0. Set ignore to 1 to skip them. |
Tips
- =TEXTJOIN(", ",TRUE,TOROW(A2:C5)) joins a whole grid into one line of text.
Questions
How do I turn a column into a row in Excel?
=TOROW(A2:A10), or TRANSPOSE. TOROW also works on grids and can skip blanks.
What is the difference between TOROW and TOCOL?
Only the direction: TOROW returns one row, TOCOL one column.
Answers that use TOROW
Updated Checked by running: every formula on this page was run by our formula engine on .