VSTACK Function

Excel 365, Excel 2021

Summary

The VSTACK function vertically stacks multiple arrays into a single larger array by appending them row-wise. This dynamic array function is perfect for combining datasets with matching column structures into one comprehensive table.

Syntax

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

Parameters

Parameter Type Required Description
array1 Array Yes Required first array or range
array2 Array No Optional additional arrays to stack (can repeat up to 254 arguments)

Using the VSTACK Function

VSTACK revolutionizes data combination in Excel by enabling seamless vertical merging of multiple ranges or arrays. Instead of complex INDEX formulas or manual copying, VSTACK creates dynamic combined datasets that automatically update when source data changes.

Common VSTACK Examples

Basic Vertical Stack

=VSTACK(A1:C2,E1:G2)

Combines two 2x3 ranges into one 4x3 array: first range on top, second range below it.

Multiple Array Stack

=VSTACK(A2:B4,C2:D3,E2:F2)

Stacks three arrays (2-col, 2-col, 2-col) into 6x2 result array.

Mixed Column Count

=VSTACK(A2:B4,C2:E3,F2:H2)

Creates 6x4 array with #N/A padding for shorter arrays.

Frequently Asked Questions

VSTACK uses the widest column count. Shorter arrays get #N/A errors in empty columns.

Yes, it works with any array size including single cells, rows, or columns.

VSTACK appends vertically (adds rows), HSTACK appends horizontally (adds columns).

Common Errors and Solutions

#N/A in result

Cause: Source arrays have different column counts

Solution: Use IFERROR(VSTACK(...),"") to replace #N/A or ensure uniform widths

#VALUE!

Cause: Invalid array arguments

Solution: Verify all arguments are valid ranges or arrays

Too many arguments

Cause: Exceeded 254 array limit

Solution: Combine arrays first or use fewer arguments

Notes

  • Available only in Excel 365 and Excel 2021
  • Result array spills automatically
  • Maximum 254 array arguments
  • Perfect companion to HSTACK for full matrix building
  • Use with FILTER, SORT for dynamic data pipelines

Compatibility

Available in: Excel 365, Excel 2021

Not available in: Excel 2019, Excel 2016, Excel 2013, Excel 2010, Excel 2007

Content last reviewed: December 9, 2025
Update frequency: As needed
Excel versions tested: Excel 365, Excel 2021