1. Home
  2. Functions
  3. Array
  4. FLATTEN

FLATTEN function

Puts the values of one or more ranges into a single column, reading row by row.

Syntax

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

Arguments

ArgumentRequiredDescription
range1RequiredA range or array
range2OptionalMore ranges or arrays

How to use FLATTEN

When FLATTEN returns more than one value, the result spills into the cells below and to the right. Keep those cells empty, or you get #SPILL!.

FLATTEN takes 1 required argument and 1 optional argument, and accepts more values in the same pattern. Type =FLATTEN( in a cell and SheetsBat shows the arguments as you go. Optional arguments are shown in square brackets; leave them out to use their default.

Examples

Each result below was calculated by the SheetsBat formula engine.

=FLATTEN({1,2;3,4})Result 4 by 1 array
Spilled result
A
11
22
33
44
=FLATTEN({1,2}, 3)Result 3 by 1 array
Spilled result
A
11
22
33

Every formula, right in your browser

SheetsBat calculates 536 functions, with charts, pivot tables and live collaboration. Free to start.