TOROW Function

Excel Functions › Lookup & Reference

Excel 365 Excel 2024+ Dynamic Array

The Excel TOROW function flattens any range or array into a single row. It’s the sideways twin of TOCOL: point it at a grid and get one horizontal list back — ideal for building header rows, dashboard strips, and inputs for functions that want a row.


Quick answer: to flatten a grid into one row, skipping the empty cells:
=TOROW(A1:C3, 1)
The second argument 1 means "ignore blanks" — leave it out and every empty cell becomes a 0 in the row.

Syntax

=TOROW(array, [ignore], [scan_by_column])
ArgumentDescription
arrayRequiredThe range or array to flatten.
ignoreOptionalWhat to skip: 0 = keep all values (default) · 1 = ignore blanks · 2 = ignore errors · 3 = ignore blanks and errors.
scan_by_columnOptionalFALSE = read row by row, left to right (default). TRUE = read column by column, top to bottom.

Same trap as TOCOL: with the default ignore of 0, empty cells come through as zeros. For real-world data, reach for =TOROW(range, 1).

Flatten a grid into one row

A shift grid sits in A1:C3 with one slot unfilled. One formula lays every name out in a single row:

ABC
1Shift 1Shift 2Shift 3
2AvaBenCleo
3DanEli
=TOROW(A2:C3, 1) // ignore=1 skips the empty Shift 2 slot
ABCDE
5AvaBenCleoDanEli

By default TOROW reads row by row: Ava, Ben, Cleo, then Dan, Eli. Set the third argument to TRUE to walk down each column first:

=TOROW(A2:C3, 1, TRUE) // column order: Ava, Dan, Ben, Cleo, Eli

Try it: interactive TOROW demo

Live demo

Flatten a 3×3 grid that contains a blank cell and a #DIV/0! error. Switch the ignore mode and scan direction and watch the row change.

The real power: build header rows and horizontal strips

Dashboards and report templates often want data running across. TOROW turns any vertical or grid-shaped source into a horizontal strip without retyping:

=TOROW(A2:A13) // a 12-row list becomes a 12-column header strip

Combine it with UNIQUE to spin up column headers straight from the data, then count against them:

=TOROW(UNIQUE(B2:B100)) // one column header per distinct category
=COUNTIF($B$2:$B$100, E1#) // counts per category, spilled across

Reshaping duo: TOROW flattens; WRAPCOLS and WRAPROWS re-fold. =WRAPROWS(TOROW(grid, 1), 4) reflows a ragged grid into tidy rows of four.

Errors & common pitfalls

Pitfall: blanks become zeros. The default ignore of 0 keeps every cell, and empty cells come through as 0. Use ignore 1 (or 3) to drop them.

#SPILL! — the row runs into something. A 200-cell grid makes a 200-column row. Make sure the cells to the right are empty — and remember the sheet ends at column XFD.

#NAME? — older Excel. TOROW requires Excel for Microsoft 365 or Excel 2024+. In older versions the name isn’t recognized.

Pitfall: errors ride along. With ignore 0 or 1, error cells from the source appear in the row and break downstream math. Use ignore 2 or 3 to drop them.

Pitfall: wrong reading order. If the flattened row looks shuffled, flip scan_by_column — FALSE reads across each row first, TRUE reads down each column first.

Practice workbook

📊
Download the free TOROW practice workbook
Every example on this page, ready to open in Excel — plus practice challenges with answers on a separate tab. No sign-up required.

Frequently asked questions

What do the ignore values 0-3 mean in TOROW?
0 keeps every value (blanks become 0), 1 ignores blanks, 2 ignores errors, 3 ignores both blanks and errors. The default is 0.
What's the difference between TOROW and TOCOL?
Output shape only. TOROW flattens the source into one row; TOCOL flattens it into one column. The ignore and scan options are identical.
What's the difference between TOROW and TRANSPOSE?
TRANSPOSE flips rows and columns but keeps the grid two-dimensional — and only turns a one-column range into a row. TOROW flattens any shape into a single row, with control over blanks, errors, and reading order.
Why does my TOROW result contain zeros?
Empty cells in the source, kept by the default ignore mode 0. Use =TOROW(range, 1) to skip blanks.
Which Excel versions have TOROW?
Excel for Microsoft 365, Excel 2024 and later, and Excel for the web. Older versions show #NAME?.

Master functions like this in one day

This page covers one function. Our Excel Formulas and Functions class covers the 30 that matter most — live, hands-on, taught by professionals in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.

See the Formulas & Functions Class

Related functions: TOCOL · WRAPCOLS · HSTACK · FILTER