# TOCOL in Google Sheets: syntax and examples

URL: https://goingstellar.ro/reference/sheets/tocol/

TOCOL stacks all values of a range or array into a single column. It can drop blanks and errors on the way and read either row by row or column by column.

## Syntax

```
TOCOL(array_or_range, [ignore], [scan_by_column])
```

## Arguments

- `array_or_range` (range, required: yes): The array or range to flatten into one column.
- `ignore` (number, required: no): 0 keeps everything (default), 1 skips blanks, 2 skips errors, 3 skips both.
- `scan_by_column` (boolean, required: no): FALSE (default) reads row by row. TRUE reads column by column.

## Examples

The examples use this table, starting in A1:

| 1 | 2 | 3 |
|---|---|---|
| 4 |  | 6 |

```
=ROWS(TOCOL(A1:C2))
```

Result: `6`

The empty cell keeps its own row: six cells in, six rows out. Run in a Google Sheet (English US locale) on 2026-11-29.

```
=TOCOL(A1:C2, 1)
```

Result: 

| 1 |
|---|
| 2 |
| 3 |
| 4 |
| 6 |

Same range, blanks skipped. Run in a Google Sheet (English US locale) on 2026-11-29.

```
=TOCOL(A1:C2, 1, TRUE)
```

Result: 

| 1 |
|---|
| 4 |
| 2 |
| 3 |
| 6 |

Blanks skipped and the scan goes down each column first: 1, 4, 2, 3, 6. Run in a Google Sheet (English US locale) on 2026-11-29.

```
=SUM(TOCOL(A1:C2, 1))
```

Result: `16`

Wrapped in another function, the single column is easy to aggregate. Run in a Google Sheet (English US locale) on 2026-11-29.

```
=TOCOL({1,2;3,4})
```

Result: 

| 1 |
|---|
| 2 |
| 3 |
| 4 |

Works on an array literal too. Run in a Google Sheet (English US locale) on 2026-11-29.

## Common errors

- By default blank cells are kept, so the output has as many rows as the range has cells. Use ignore 1 to drop them.
- ignore 1 removes only blanks. Errors stay in the output until you use 2.
- The default scan is row by row. If the order matters, set scan_by_column to TRUE and check the first values.
- The ignore argument only accepts 0 to 3. A value such as 4 returns #VALUE!.

## Compared with Excel

Excel 365 has TOCOL with the same arguments.

## Related functions

- [FLATTEN](https://goingstellar.ro/reference/sheets/flatten/)
- [TRANSPOSE](https://goingstellar.ro/reference/sheets/transpose/)
- [FILTER](https://goingstellar.ro/reference/sheets/filter/)
- [ARRAYFORMULA](https://goingstellar.ro/reference/sheets/arrayformula/)
- [SORT](https://goingstellar.ro/reference/sheets/sort/)

## Sources

- [TOCOL (Docs Editors Help)](https://support.google.com/docs/answer/13187258)

