TOROW function
Turns a range or array into a single row, reading row by row (or column by column), with options to skip blanks and errors.
Available in Microsoft 365, Excel 2024, Excel for the web, Excel for Mac 2024+
Excel 2024 and laterWorks in Google Sheets
Syntax
TOROW(array, [ignore], [scan_by_column])| Argument | What it means | |
|---|---|---|
array | Required | The range or array to flatten. |
ignore | Optional | 0 keep everything (default), 1 skip blanks, 2 skip errors, 3 skip both. |
scan_by_column | Optional | FALSE (default) reads across rows first; TRUE reads down columns first. |
Returns: A single-row array containing every value of array, which spills to the right.
How TOROW works
TOROW is the horizontal twin of TOCOL: it flattens a block of cells into one row. It is handy for building a header row from a list, for joining values into a single line before TEXTJOIN, or for turning a small grid into a strip for a dashboard.
Values are read row by row unless you set scan_by_column to TRUE. Blanks turn into 0 unless ignore is 1 or 3. Keep in mind that a row has 16,384 columns at most, so for long lists TOCOL is usually the better choice.
Examples
1Roster in one row, no blanks
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Mon | Tue | Wed | ||
| 2 | Ana | Ben | Ana | ||
| 3 | Raj | Chloe | |||
| 4 | |||||
| 5 | Ana | Ben | Ana | Raj | Chloe |
Each row of names is read left to right and the blank cell is skipped.
2Read column by column
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Mon | Tue | Wed | ||
| 2 | Ana | Ben | Ana | ||
| 3 | Raj | Chloe | |||
| 4 | |||||
| 5 | Ana | Raj | Ben | Ana | Chloe |
With scan_by_column TRUE the order follows the days: Monday's two names, then Tuesday's, then Wednesday's.
Common errors and how to fix them
| Error | Why it happens | Fix |
|---|---|---|
#SPILL! | Cells to the right of the formula are not empty. | Clear them or place the formula elsewhere. |
#NUM! | The result would be wider than 16,384 columns. | Use TOCOL instead. |
Tips
=TEXTJOIN(", ", TRUE, TOROW(A2:C3, 1))writes the roster as one sentence.- Use TRANSPOSE instead when you want to keep the grid shape but swap rows and columns.
Google Sheets
TOROW also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.
TOROW in other languages
In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.
| Language | Function name |
|---|---|
| Dutch | NAAR.RIJ |
| Finnish | RIVIIN |
| French | DANSLIGNE |
| German | ZUZEILE |
| Polish | DO.WIERSZA |
| Russian | ПОСТРОК |
| Swedish | TILLRAD |
| Turkish | SATIRA |