VSTACK function

VSTACK combines multiple arrays or ranges by stacking them vertically into a single array, placing each input one below the other.

=VSTACK(array1, ...)

Generate a VSTACK formula

Describe what you need. The generator will reach for VSTACK where VSTACK is the right tool, and tell you when it is not.

How to get a better answer
  • Name your columns by letter and by header: "column F (Net Value)" beats "the amount column".
  • State every condition, including the negatives — "not cancelled" changes the formula's shape.
  • Say where the data starts if it is not row 1, and whether it will grow.
  • Check the settings above match your spreadsheet: the wrong argument separator is a syntax error on your machine.

Arguments

How VSTACK reads its arguments
array1requiredVSTACK
ArgumentRequiredDescription
array1RequiredRequired. The first array or range to stack; can be a cell range, array constant, or result from another function.
...RepeatingOptional. Additional arrays or ranges to stack below array1; all inputs are combined in order from top to bottom.

Returns

An array with all rows from each input array combined vertically; the number of columns matches the widest input.

Availability

Excel: 365 · Google Sheets: Not available

Worked examples

1. Combine two separate campaign reports

CampaignChannelSpendClicksConversions
Q4 SaleEmail150045032
Q4 SaleSocial220068041
Q4 SaleSearch300092078
Spring RefreshEmail120038028
Spring RefreshDisplay180052031
=VSTACK(A1:E3, A5:E6)

Result: A 6-row array combining both campaign reports into one unified table

VSTACK takes the Q4 Sale table (4 rows including header) and places the Spring Refresh table directly below it, creating one unified report with all campaigns. Both tables must have the same number of columns; VSTACK preserves headers and data from both sources without modification.

2. Stack email-channel rows from different reports

CampaignChannelSpendClicksConversions
Q4 SaleEmail150045032
Q4 SaleSocial220068041
Q4 SaleSearch300092078
Spring RefreshEmail120038028
Spring RefreshDisplay180052031
=VSTACK(FILTER(A2:E4, B2:B4="Email"), FILTER(A5:E6, B5:B6="Email"))

Result: A 2-row array containing only email campaigns from both Q4 and Spring periods

FILTER extracts only Email rows from each report, then VSTACK combines them vertically. The result shows email performance across both campaigns, omitting Social and Search. This pattern isolates and compares a specific segment across multiple datasets in one step.

3. Add a totals row beneath campaign data

CampaignChannelSpendClicksConversions
Q4 SaleEmail150045032
Q4 SaleSocial220068041
Q4 SaleSearch300092078
=VSTACK(A2:E4, {"TOTAL", "", SUM(C2:C4), SUM(D2:D4), SUM(E2:E4)})

Result: A 4-row array with campaign data followed by a summary totals row (TOTAL, , 6700, 2050, 151)

VSTACK combines the Q4 campaign data with a manually constructed summary row. The second argument is an array constant (defined with curly braces) that calculates totals for Spend, Clicks, and Conversions. This approach appends summary metrics without modifying the source data or requiring a separate table.

Common errors

Which VSTACK error are you seeing?
VSTACK returned an error#REF!
Verify all ranges in the VSTACK formula still exist and are accessible; update or correct any references to deleted rows, columns, or sheets.
#VALUE!
Ensure all input arrays have the same column count, or use EXPAND to pad arrays to match width before stacking them together.
#SPILL!
Clear or move data in the target area below and to the right of the formula, or recalculate the formula in an area with sufficient empty space.
ErrorWhy it happensHow to fix it
#REF!One of the array arguments references a deleted range, a sheet that no longer exists, or an invalid cell reference.Verify all ranges in the VSTACK formula still exist and are accessible; update or correct any references to deleted rows, columns, or sheets.
#VALUE!The arrays have a different number of columns, and VSTACK cannot align them vertically; or a non-array value (like plain text) was passed where an array is required.Ensure all input arrays have the same column count, or use EXPAND to pad arrays to match width before stacking them together.
#SPILL!The result would spill into cells that already contain data, formulas, or are protected, blocking the array from expanding into the output area.Clear or move data in the target area below and to the right of the formula, or recalculate the formula in an area with sufficient empty space.

Tips and when to use something else

  • VSTACK stacks arrays vertically (rows appended downward); if you need to combine arrays side-by-side, use HSTACK instead.
  • All arrays should have the same number of columns for predictable output; mismatched column counts produce #VALUE! errors.
  • VSTACK pairs well with FILTER to stack filtered subsets or with UNIQUE to remove duplicates after combining datasets.
  • The order of arguments matters: the first array appears at the top of the result, and subsequent arrays are appended below in the order you list them.

Frequently asked questions

Can VSTACK combine arrays with different numbers of rows but the same columns?
Yes, VSTACK is designed for this. It stacks arrays of any height as long as they have the same column count. If column counts differ, you'll get a #VALUE! error.
How many arrays can I stack with VSTACK at once?
You can pass up to 254 arrays as arguments to VSTACK. Each is added vertically in order, so =VSTACK(A1:A10, B1:B10, C1:C10, ...) is valid as long as you don't exceed the limit.
What happens if one of the stacked arrays contains errors or empty cells?
VSTACK preserves all content, including errors (like #N/A) and blanks. If you need to clean data before stacking, use FILTER or IF to remove errors or empty rows first.
Is VSTACK the same as copying and pasting data into one range?
VSTACK creates a dynamic, live array that updates if the source data changes; copy-paste creates static values. VSTACK is better for reports that need to update automatically when source data is modified.

Need a different formula?

The full generator is not scoped to one function — describe any spreadsheet problem and it will pick.

Open the formula generator

Reviewed 2026-09-17