Lookup & reference function

VSTACK function

Stacks ranges or arrays on top of each other into one array - for example several monthly lists or the same table from several sheets.

Available in Microsoft 365, Excel 2024, Excel for the web, Excel for Mac 2024+

Excel 2024 and laterWorks in Google Sheets

Syntax

VSTACK(array1, [array2], ...)
ArgumentWhat it means
array1RequiredThe first range or array (it goes on top).
array2, ...OptionalMore ranges or arrays to append underneath, in order.

Returns: One array as wide as the widest input and as tall as all inputs combined; it spills.

How VSTACK works

VSTACK appends lists under each other. If each store, month or salesperson has its own table - even on different sheets - VSTACK combines them into one long list that you can then sort, filter or summarise with a single formula. It also accepts a 3D reference such as Jan:Mar!A2:B20, which stacks the same range from every sheet between Jan and Mar.

Inputs are placed top to bottom in the order you list them. If they have different widths the narrower ones are padded with #N/A; wrap in IFNA or use EXPAND to control that. A common pattern is to include the header from the first table only, then the data rows of every table. Its side-by-side partner is HSTACK.

Examples

1Combine two store lists

G2fx=VSTACK(A2:B3, D2:E3)
ABCDEFGH
1ProductUnitsProductUnits
2Keyboard120Keyboard95Keyboard120
3Mouse340Mouse280Mouse340
4Keyboard95
5Mouse280

Store A's rows come first, then Store B's, making one four-row list.

2Keep one header

G1fx=VSTACK(A1:B3, D2:E3)
ABCDEFGH
1ProductUnitsProductUnitsProductUnits
2Keyboard120Keyboard95Keyboard120
3Mouse340Mouse280Mouse340
4Keyboard95
5Mouse280

The first range includes its header row; the second starts at row 2 so the header is not repeated.

3Stack, then sort

G2fx=SORT(VSTACK(A2:B3, D2:E3), 2, -1)
ABCDEFGH
1ProductUnitsProductUnits
2Keyboard120Keyboard95Mouse340
3Mouse340Mouse280Mouse280
4Keyboard120
5Keyboard95

The combined list is sorted by units, largest first.

⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 16 KB

Common errors and how to fix them

ErrorWhy it happensFix
#N/AInputs of different widths were padded.Use IFNA or EXPAND so all inputs have the same width.
#SPILL!Not enough empty cells below the formula.Clear the output area.

Tips

  • Stack whole tables but drop blanks: =FILTER(VSTACK(T1, T2), CHOOSECOLS(VSTACK(T1, T2), 1)<>"").
  • Stack the same range from all monthly sheets with =VSTACK(Jan:Dec!A2:C50).
  • Feed the stacked list to GROUPBY to summarise several sources at once.

Google Sheets

VSTACK also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.

VSTACK in other languages

In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.

LanguageFunction name
CzechSROVNAT.SVISLE
DanishVSTAK
DutchVERT.STAPELEN
FinnishVPINO
FrenchASSEMB.V
GermanVSTAPELN
HungarianFÜGG.HALMOZÁS
ItalianSTACK.VERT
Norwegian (Bokmål)VSTAKK
PolishSTOS.PION
Portuguese (Brazil)EMPILHARV
Portuguese (Portugal)JUNTARV
RussianВСТОЛБИК
SpanishAPILARV
TurkishDÜŞEYYIĞ