Category: FUNCTION | Updated: 2026-11-22
How to Use the FLATTEN Function in Google Sheets | Combine Multiple Ranges into One Column
What Is the FLATTEN Function?
The FLATTEN function combines all values from one or more cell ranges into a single vertical column (a 1D array). It is very useful for consolidating lists scattered across multiple columns or preparing data for deduplication (when combined with UNIQUE).
Syntax
=FLATTEN(range1, [range2, ...])
- range1: The first cell range or value to flatten into a single column.
- range2, … (optional): Additional cell ranges or values to append, separated by commas.
Practical Examples
This example combines a 2-column × 3-row table in A1:B3 into a single column starting at D1 using FLATTEN.
| Row | Col A (Team A) | Col B (Team B) | Formula in Col D | Output in Col D |
|---|---|---|---|---|
| 1 | Sato | Suzuki | =FLATTEN(A1:B3) |
Sato |
| 2 | Takahashi | Tanaka | (Auto-expanded) | Suzuki |
| 3 | Ito | Watanabe | (Auto-expanded) | Takahashi |
| 4 | (Auto-expanded) | Tanaka | ||
| 5 | (Auto-expanded) | Ito | ||
| 6 | (Auto-expanded) | Watanabe |
Common Errors and Precautions
#REF!error (array result was not expanded):FLATTENis a spill (array) function that outputs results across multiple cells. If cells below the formula already contain values or formulas, a#REF!error occurs. Keep the output column clear.- To exclude blank cells: Any blank cells in the source range will appear as blank rows in the output. To remove blanks cleanly, combine it with
FILTER:=FILTER(FLATTEN(A1:B3), FLATTEN(A1:B3)<>""). - Compatibility with Excel:
FLATTENis unique to Google Sheets (Excel uses theTOCOLfunction for the same purpose). Google Sheets now also supportsTOCOL, so consider usingTOCOLif cross-platform compatibility is important.
Frequently Asked Questions
Q. What happens to blank cells when flattening into one column with FLATTEN?
A. Blank cells are also output as blank rows. To exclude blanks, combine FLATTEN with the QUERY or FILTER function.
Q. Does FLATTEN order data row-by-row or column-by-column?
A. It reads data row by row (from left to right) and stacks it from top to bottom into a single column. After finishing row 1 from left to right, it moves to row 2 from left to right.