Function · Shape arrays

Excel VSTACK function

The Excel VSTACK function stacks arrays on top of each other. Austin and Dallas, then Houston and San Antonio, spill as four rows.

Microsoft 365 and Excel 2024, including Excel for the web. Also in Google Sheets. Excel 2021 does not have it.

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

VSTACK
=VSTACK(A1:A2,B1:B2)

Arguments

NameRequiredWhat to pass
array1RequiredThe first array. It becomes the top of the result.
array2OptionalMore arrays, placed underneath. Wider arrays cause #N/A padding in the narrower ones.

Examples

Two city lists in one column

=VSTACK(A1:A2,B1:B2)

Result Austin, Dallas, Houston, San Antonio

=VSTACK(A1:A2,B1:B2)D1
Stacked
ABCD
1AustinHoustonAustin
2DallasSan AntonioDallas
3Houston
4San Antonio
A picture of the sheet, not a live calculator. D2:D4 are the spill.

VSTACK appends arrays vertically. Austin and Dallas, followed by Houston and San Antonio, spill as four rows in that order. Nothing is sorted and duplicates are kept. UNIQUE of the spill is the extra step when the two lists overlap.

Different widths are padded with #N/A, the same rule HSTACK uses for different heights. EXPAND can widen the short row with 0 or a blank before you stack. A header in both arrays shows up twice, once from each list. Drop the header from the second array before you stack, or DROP it afterward. Excel 2021 does not have VSTACK.