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

VSTACK function

Stacks arrays on top of each other; shorter rows are padded with #N/A.

Syntax

=VSTACK(array1, [array2], ...)

Arguments

ArgumentRequiredDescription
array1RequiredA range or array
array2OptionalMore ranges or arrays

How to use VSTACK

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

VSTACK takes 1 required argument and 1 optional argument, and accepts more values in the same pattern. Type =VSTACK( 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.

=VSTACK({1,2}, {3,4})Result 2 by 2 array
Spilled result
AB
112
234
=VSTACK({1,2}, 3)Result 2 by 2 array
Spilled result
AB
112
23#N/A

Every formula, right in your browser

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