Array

TOCOL Formula

Converts a multi-column array or range into a single column by reading values either row by row or column by column. TOCOL is essential for reshaping data — for instance, taking a 3x4 grid and stacking all 12 values into one column for use with UNIQUE, SORT, or other functions that expect a single-column input.

Syntax

TOCOL(array, [ignore], [scan_by_column])
ParameterDescription
array Parameter of the TOCOL function.
[ignore] (Optional.) Parameter of the TOCOL function.
[scan_by_column] (Optional.) Parameter of the TOCOL function.
Try TOCOL in Viztab — free, no signup

Examples

Flatten a grid to one column

Formula
=TOCOL(A1:C4)
Returns all 12 values from the 4x3 grid as a single 12-row column, reading left-to-right then top-to-bottom by default.

Flatten and skip blanks

Formula
=TOCOL(A1:C4, 1)
Same as above but skips any blank cells. The ignore argument: 0 = keep all, 1 = skip blanks, 2 = skip errors, 3 = skip both.

Read by column instead of row

Formula
=TOCOL(A1:C4, 0, TRUE)
Reads column A top-to-bottom first, then column B, then column C. The scan_by_column argument changes the read order.

Common Errors

#CALC!

After ignoring blanks/errors, the result would be an empty array with zero elements.

#SPILL!

The output range is blocked by non-empty cells.

Tips

Pair with UNIQUE

=UNIQUE(TOCOL(A1:D10)) gives you a deduplicated list of all values in a multi-column range, flattened into one column.

Ignore parameter is powerful

Set ignore to 3 to strip out both blanks and errors before passing data downstream. This saves nested IFERROR wrappers.

TOCOL vs TOROW

TOCOL stacks into a column, TOROW stretches into a row. Pick whichever orientation your downstream formula expects.

Try TOCOL in Viztab

Import your data and use TOCOL with 370+ other formulas. No signup required.

Open Viztab

Related Formulas