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], ...)| Argument | What it means | |
|---|---|---|
array1 | Required | The first range or array (it goes on top). |
array2, ... | Optional | More 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
| A | B | C | D | E | F | G | H | |
|---|---|---|---|---|---|---|---|---|
| 1 | Product | Units | Product | Units | ||||
| 2 | Keyboard | 120 | Keyboard | 95 | Keyboard | 120 | ||
| 3 | Mouse | 340 | Mouse | 280 | Mouse | 340 | ||
| 4 | Keyboard | 95 | ||||||
| 5 | Mouse | 280 |
Store A's rows come first, then Store B's, making one four-row list.
2Keep one header
| A | B | C | D | E | F | G | H | |
|---|---|---|---|---|---|---|---|---|
| 1 | Product | Units | Product | Units | Product | Units | ||
| 2 | Keyboard | 120 | Keyboard | 95 | Keyboard | 120 | ||
| 3 | Mouse | 340 | Mouse | 280 | Mouse | 340 | ||
| 4 | Keyboard | 95 | ||||||
| 5 | Mouse | 280 |
The first range includes its header row; the second starts at row 2 so the header is not repeated.
3Stack, then sort
| A | B | C | D | E | F | G | H | |
|---|---|---|---|---|---|---|---|---|
| 1 | Product | Units | Product | Units | ||||
| 2 | Keyboard | 120 | Keyboard | 95 | Mouse | 340 | ||
| 3 | Mouse | 340 | Mouse | 280 | Mouse | 280 | ||
| 4 | Keyboard | 120 | ||||||
| 5 | Keyboard | 95 |
The combined list is sorted by units, largest first.
Common errors and how to fix them
| Error | Why it happens | Fix |
|---|---|---|
#N/A | Inputs 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.
| Language | Function name |
|---|---|
| Czech | SROVNAT.SVISLE |
| Danish | VSTAK |
| Dutch | VERT.STAPELEN |
| Finnish | VPINO |
| French | ASSEMB.V |
| German | VSTAPELN |
| Hungarian | FÜGG.HALMOZÁS |
| Italian | STACK.VERT |
| Norwegian (Bokmål) | VSTAKK |
| Polish | STOS.PION |
| Portuguese (Brazil) | EMPILHARV |
| Portuguese (Portugal) | JUNTARV |
| Russian | ВСТОЛБИК |
| Spanish | APILARV |
| Turkish | DÜŞEYYIĞ |