In Excel: use =TOCOL(array, 3) — it flattens a two-dimensional grid into a single column, and the ignore argument decides what is dropped: 0 keeps everything, 1 skips blanks, 2 skips errors, 3 skips both. Function availability: TOCOL: Excel 2024+. These are Microsoft's version markers; earlier perpetual releases do not include these functions. Check the actual product and update channel before using the formula. A marker does not establish an identical Web/Mac workflow or Google Sheets support.
On this page8
Syntax
Arguments
| Argument | required / optional | Description |
|---|---|---|
array | required | The range or grid to flatten. |
ignore | optional | 0 keep everything, 1 skip blanks, 2 skip errors, 3 skip both. |
scan_by_column | optional | TRUE reads down columns first; FALSE or omitted reads across rows. |
Related functions
Function availability: TOCOL: Excel 2024+. These are Microsoft's version markers; earlier perpetual releases do not include these functions. Check the actual product and update channel before using the formula. A marker does not establish an identical Web/Mac workflow or Google Sheets support.
Click a cell with enough empty rows below for the whole flattened result.
Type =TOCOL( and select the grid.
Add a comma and 3 to skip both blanks and errors — the usual choice.
Wrap the result in UNIQUE, SORT or FILTER as the analysis needs.
What this does
TOCOL turns a rectangular range into one column and TOROW into one row. That sounds like a niche reshaping trick until you meet the problem it solves: lookup and aggregation functions want a single column, and data frequently arrives as a grid — a matrix of values by month across, product down. Flattening it makes UNIQUE, FILTER and COUNTIF work on it directly. The ignore argument is what makes the result usable, dropping the blanks and errors that a ragged grid is full of. Excel 365 only. The same idea underpins a lot of everyday Excel work, so the few minutes spent getting it right here pay back across every sheet you build afterwards. Treat it as a pattern, not a one-off, and it stops being something you look up and starts being something you reach for. Treat “tocol function in excel” as a small repeatable workflow rather than a one-off click you hope to remember next time. Use a small test block before the live file, so any surprise in the affected formula shows up while it is still harmless. When a formula is involved, keep the inputs labelled beside it, reference cells instead of typing values, and apply number formatting only after the result checks out. That turns a calculation you can defend to a CFO or an auditor into a method you can reuse, explain, and defend when the workbook leaves your screen.
A worked example
Flattening a 12×20 grid into one clean column, blanks and errors removed: =TOCOL(B2:M21, 3). A deduplicated list of every value that appears anywhere in a grid: =UNIQUE(TOCOL(B2:M21, 3)). Counting how many non-blank cells the grid holds: =ROWS(TOCOL(B2:M21, 1)). TOCOL turns a report-shaped grid back into analysable data, which is the step that makes every other array function apply to it. Check the referenced cells, argument order and result type in your workbook. Start with the worked example before changing an input, then compare the changed result with the calculation you expected. An error value or a result of a different type is a reason to inspect the inputs and arguments.
In Google Sheets
Function availability: TOCOL: Excel 2024+. These are Microsoft's version markers; earlier perpetual releases do not include these functions. Check the actual product and update channel before using the formula. A marker does not establish an identical Web/Mac workflow or Google Sheets support. Keep this page bookmarked for the next time the same question comes up. Better still, repeat the steps once in your own workbook — doing it yourself is what turns a copied answer into something you remember. For “tocol function in excel”, keep the input cells and the result visible while you check the formula in Excel. Follow the worked example and change one input at a time. The steps explain the workbook calculation; this page does not run a live calculator for that task.
Common mistakes
- Omitting the ignore argument on a ragged grid, which fills the result with blanks and errors.
- Underestimating the output length — a 12×20 grid flattens to 240 rows and needs the room.
- Using them in Excel 2021 or earlier, where they do not exist.
Frequently asked questions
How do I turn a grid into a single column?
=TOCOL(range, 3) flattens it and skips blanks and errors.
Which order does it read in?
Across rows by default. Pass TRUE as the third argument to read down columns first.
Why do I need this?
Because UNIQUE, FILTER, COUNTIF and the lookup functions all expect a single column, and real data often arrives as a grid.
Which Excel release does this formula require?
Function availability: TOCOL: Excel 2024+. These are Microsoft's version markers; earlier perpetual releases do not include these functions. Check the actual product and update channel before using the formula. A marker does not establish an identical Web/Mac workflow or Google Sheets support.