VSTACK Function

Excel Functions › Lookup & Reference

Excel 365 Excel 2024+ Dynamic Array

The Excel VSTACK function stacks two or more ranges or arrays vertically — one on top of the other — into a single spilled result. It replaces copy-paste consolidation: combine the regions, the months, or the sheets in one live formula, then feed the result straight into SORT, UNIQUE, or FILTER.


Quick answer: to stack two tables into one combined list:
=VSTACK(A2:B4, D2:E4)
The result spills below the formula. Arrays should have the same number of columns — VSTACK pads narrower arrays with #N/A.

Syntax

=VSTACK(array1, [array2], …)
ArgumentDescription
array1RequiredThe first range or array to stack.
array2, …OptionalMore ranges or arrays, appended in order below the previous one. Up to 254 in total.

Available in: Excel for Microsoft 365, Excel 2024+, and Excel for the web. Older versions show #NAME?. The row counts of the arrays can differ freely; it’s the column counts that should match.

Stack two tables into one list

Two regional sales tables sit side by side — North in A1:B4, South in D1:E4. One formula combines their data rows into a single list:

ABDE
1ProductSalesProductSales
2Laptops$12,400Laptops$9,800
3Monitors$8,100Tablets$6,300
4Keyboards$2,950Monitors$7,450
=VSTACK(A2:B4, D2:E4) // spills a 6-row x 2-column result

The combined result spills down from the formula cell:

GH
1Laptops$12,400
2Monitors$8,100
3Keyboards$2,950
4Laptops$9,800
5Tablets$6,300
6Monitors$7,450

Want the header row once on top? Just stack it first:

=VSTACK(A1:B1, A2:B4, D2:E4) // headers + North + South

Try it: interactive VSTACK demo

Live demo

Pick any two tables to stack — including a 1-column table, so you can see the #N/A padding for yourself.

The real power: combine sheets, then sort and de-duplicate

VSTACK accepts ranges from different sheets, including 3-D references across a run of identically laid-out tabs:

=VSTACK(Jan!A2:C20, Feb!A2:C20, Mar!A2:C20) // three sheets, one list
=VSTACK(Jan:Mar!A2:C20) // 3-D reference - every sheet from Jan through Mar

Because the output is a dynamic array, it nests cleanly inside other array functions. A sorted, de-duplicated master list from three sheets is one formula:

=SORT(UNIQUE(VSTACK(Jan:Mar!A2:C20)))

Trim the blanks: stacking fixed-size ranges often drags in empty rows. Wrap the stack in FILTER to keep only rows with data: =LET(s, VSTACK(Jan:Mar!A2:C20), FILTER(s, CHOOSECOLS(s,1)<>"")).

Errors & common pitfalls

#N/A — ragged widths. If one array has fewer columns than another, VSTACK pads the missing cells with #N/A. Supply equal-width arrays, or wrap the stack in IFERROR to blank the padding: =IFERROR(VSTACK(a, b), "").

#SPILL! — no room to land. The combined array needs empty cells below and beside the formula. Clear the blocking cells — the error tooltip points at them.

#NAME? — older Excel. VSTACK requires Excel for Microsoft 365 or Excel 2024+. In older versions the name isn’t recognized.

Pitfall: stacked headers. Stacking whole tables repeats each table’s header row in the middle of the data. Stack the header range once, then the data-only ranges.

Pitfall: the result is values only. VSTACK copies values, not formatting — currency formats, colors, and column widths don’t travel with the data.

Practice workbook

📊
Download the free VSTACK practice workbook
Every example on this page, ready to open in Excel — plus practice challenges with answers on a separate tab. No sign-up required.

Frequently asked questions

Which Excel versions have VSTACK?
Excel for Microsoft 365, Excel 2024 and later, and Excel for the web. Older versions (2021, 2019, 2016) show #NAME?.
What happens when my arrays have different sizes?
Different row counts are fine — that’s the whole point. Different column counts cause VSTACK to pad the narrower array with #N/A. Supply equal widths, or wrap in IFERROR to blank the padding.
Can VSTACK combine ranges from different sheets?
Yes — list them as separate arguments, or use a 3-D reference across identically structured tabs: =VSTACK(Jan:Dec!A2:C20).
How do I sort or remove duplicates from the stacked result?
Nest it: =SORT(VSTACK(a, b)) or =UNIQUE(VSTACK(a, b)) — or both at once. The stack is a normal dynamic array and feeds any array function.
What's the difference between VSTACK and HSTACK?
Direction. VSTACK appends arrays below each other (more rows); HSTACK appends them beside each other (more columns).

Master functions like this in one day

This page covers one function. Our Excel Formulas and Functions class covers the 30 that matter most — live, hands-on, taught by professionals in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.

See the Formulas & Functions Class

Related functions: HSTACK · TOCOL · WRAPROWS · FILTER · XLOOKUP