(Office Insider Beta only)
Windows: 2203 (Build 15104)
Mac: 16.60 (220304)

Appends arrays vertically and in sequence to the first blank cell at the bottom of a range.

Syntax

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

The VSTACK function syntax has the following argument:

array    The arrays to append.

Remarks

VSTACK returns the array formed by appending each of the array arguments in a row-wise fashion. The resulting array will be the following dimensions:

  • Rows: the combined count of all the rows from each of the array arguments.

  • Columns: The maximum of the column count from each of the array arguments.

Errors

If an array has fewer columns than the maximum width of the selected arrays, Excel returns a #N/A error in the additional columns. Use VSTACK inside the IFERROR function to replace #N/A with the value of your choice.

Examples

Copy the example data in the following table and paste it in cell A1 of a new Excel worksheet. If you need to, you can adjust the column widths to see all the data.

Appends three arrays in sequence so that the results are one array of two columns and six rows.

Data

1

2

A

B

X

Y

3

4

C

D

5

6

Formulas

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

Appends three arrays in sequence so that the results are one array of three columns and six rows with a #N/A error to fill in empty array elements.

Data

1

2

A

B

C

#VALUE!

3

4

D

E

F

5

6

Formulas

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

See Also

Guidelines and examples of array formulas

HSTACK function

CHOOSEROWS function

CHOOSECOLS function

Need more help?

Expand your skills
Explore Training
Get new features first
Join Microsoft Office Insiders

Was this information helpful?

What affected your experience?

Thank you for your feedback!

×