Lookup & reference function

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])
ArgumentWhat it means
arrayRequiredThe range or array to flatten.
ignoreOptional0 keep everything (default), 1 skip blanks, 2 skip errors, 3 skip both.
scan_by_columnOptionalFALSE (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

A5fx=TOROW(A2:C3, 1)
ABCDE
1MonTueWed
2AnaBenAna
3RajChloe
4
5AnaBenAnaRajChloe

Each row of names is read left to right and the blank cell is skipped.

2Read column by column

A5fx=TOROW(A2:C3, 1, TRUE)
ABCDE
1MonTueWed
2AnaBenAna
3RajChloe
4
5AnaRajBenAnaChloe

With scan_by_column TRUE the order follows the days: Monday's two names, then Tuesday's, then Wednesday's.

⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 14 KB

Common errors and how to fix them

ErrorWhy it happensFix
#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.

LanguageFunction name
DutchNAAR.RIJ
FinnishRIVIIN
FrenchDANSLIGNE
GermanZUZEILE
PolishDO.WIERSZA
RussianПОСТРОК
SwedishTILLRAD
TurkishSATIRA

Recipes that use TOROW