# FLATTEN in Google Sheets: syntax and examples

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

FLATTEN takes a block of cells and returns every value in one column. It reads the range row by row, then moves to the next range. It is handy before SORT, UNIQUE, SUM or JOIN.

## Syntax

```
FLATTEN(range1,[range2,...])
```

## Arguments

- `range1` (range, required: yes): The first range or array to flatten.
- `range2, ...` (range, required: no): More ranges, appended below the first.

## Examples

The examples use this table, starting in A1:

| Name | Q1 | Q2 |
|---|---|---|
| Ana | 10 | 20 |
| Bob | 5 | 15 |
| Cris | 7 | 8 |

```
=FLATTEN(B2:C2, B3)
```

Result: 

| 10 |
|---|
| 20 |
| 5 |

A row and a single cell become one column, in the order given. Run in a Google Sheet (English US locale) on 2026-11-29.

```
=FLATTEN(A2:A3, A4)
```

Result: 

| Ana |
|---|
| Bob |
| Cris |

Two ranges stacked into one column. Run in a Google Sheet (English US locale) on 2026-11-29.

```
=SUM(FLATTEN(B2:C4))
```

Result: `65`

Flatten first, then aggregate: total of all values. Run in a Google Sheet (English US locale) on 2026-11-29.

```
=SORT(FLATTEN(B2:C2, B3), 1, FALSE)
```

Result: 

| 20 |
|---|
| 10 |
| 5 |

The flattened values, largest first. Run in a Google Sheet (English US locale) on 2026-11-29.

```
=FLATTEN(A1:C1, A2:C2)
```

Result: 

| Name |
|---|
| Q1 |
| Q2 |
| Ana |
| 10 |
| 20 |

Header row followed by the first data row, in one column. Run in a Google Sheet (English US locale) on 2026-11-29.

## Common errors

- The order is by rows, not by columns. To read down the columns first, transpose the range before flattening.
- The first range is read completely before the next one is appended, so the order of arguments sets the order of the output.
- FLATTEN returns one column even for a wide range. To lay the values out in a row, wrap the call in TRANSPOSE.

## Compared with Excel

Excel has no FLATTEN. TOCOL (Excel 365) is the closest match, and Google Sheets has TOCOL as well.

## Related functions

- [TRANSPOSE](https://goingstellar.ro/reference/sheets/transpose/)
- [TOCOL](https://goingstellar.ro/reference/sheets/tocol/)
- [UNIQUE](https://goingstellar.ro/reference/sheets/unique/)
- [SORT](https://goingstellar.ro/reference/sheets/sort/)
- [HSTACK](https://goingstellar.ro/reference/sheets/hstack/)
- [ARRAYFORMULA](https://goingstellar.ro/reference/sheets/arrayformula/)

## Sources

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

