TOCOL Function

Excel Functions › Lookup & Reference

Excel 365 Excel 2024+ Dynamic Array

The Excel TOCOL function flattens any range or array into a single column. It’s the fastest way to turn a grid — a schedule, a matrix, a multi-column dump — into a clean list you can sort, de-duplicate, count, or feed into FILTER and XLOOKUP.


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

Syntax

=TOCOL(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.

The blank-cells-become-zero trap: with the default ignore of 0, every empty cell in the grid lands in your list as a 0. For real-world data, =TOCOL(range, 1) is almost always what you want.

Flatten a grid into one clean list

A weekly staffing grid sits in A1:C4 — names scattered across three day-columns, with one slot unfilled. One formula in E2 turns it into a single roster:

ABCE
1MonTueWedOne column
2AvaBenCleoAva
3DanEliBen
4FayGusHanaCleo
5Dan
6Eli
7Fay
8Gus
9Hana
=TOCOL(A2:C4, 1) // ignore=1 skips the empty Tue slot

By default TOCOL reads the grid row by row: Ava, Ben, Cleo, then Dan, Eli… Set the third argument to TRUE to read down each column instead:

=TOCOL(A2:C4, 1, TRUE) // column order: Ava, Dan, Fay, Ben, Gus, ...

Try it: interactive TOCOL 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 output list change.

The real power: unpivot a grid for analysis

Grids are great for humans and terrible for formulas. COUNTIF, UNIQUE, SORT, and pivot-style analysis all want a flat list — and TOCOL delivers one without touching the original layout:

=SORT(UNIQUE(TOCOL(A2:F13, 3))) // every distinct entry in the grid, sorted
=ROWS(TOCOL(A2:F13, 1)) // how many cells are actually filled?

TOCOL also pairs with WRAPROWS as a reshaping duo: flatten a grid with TOCOL, then re-wrap it to a different width:

=WRAPROWS(TOCOL(A2:F13, 1), 4, "") // reflow a ragged grid into tidy rows of 4

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! — no room to land. A big grid makes a long column. Make sure the cells below the formula are empty — or flatten with ignore 1 or 3 to shorten the list.

#NAME? — older Excel. TOCOL 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, any error cell in the grid appears in your list and can poison downstream formulas like SUM. Use ignore 2 or 3 to drop errors.

Pitfall: wrong reading order. If your flattened list looks shuffled, you probably need the other scan direction — flip scan_by_column between FALSE (row by row) and TRUE (column by column).

Practice workbook

📊
Download the free TOCOL 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 TOCOL?
0 keeps every value (blanks become 0), 1 ignores blanks, 2 ignores errors, 3 ignores both blanks and errors. The default is 0.
Why does TOCOL show zeros where my grid has empty cells?
That’s the default ignore mode 0, which keeps all cells — and an empty cell’s value is 0. Use =TOCOL(range, 1) to skip blanks.
What's the difference between TOCOL and TRANSPOSE?
TRANSPOSE flips a grid’s rows and columns but keeps it two-dimensional. TOCOL flattens the entire grid into a single column, with control over reading order and what to skip.
In what order does TOCOL read the grid?
Row by row (left to right, then down) by default. Set the third argument to TRUE to read column by column (top to bottom, then right): =TOCOL(range, 1, TRUE).
Which Excel versions have TOCOL?
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: TOROW · WRAPROWS · VSTACK · FILTER