VSTACK
Concatenates arrays vertically into a single spilled array.
VSTACK appends rows from each argument top-to-bottom.
The Formualizer engine in this repository at 0.15.0 plus unreleased changes computes the example results. Known differences from Excel are listed on this page.
Syntax
=VSTACK(array1, [array2], ...)
Arguments
| Argument | Type | Required | Default |
|---|---|---|---|
array1 | range or any (range) | Required | — |
array2 | range or any (range) | Optional | — |
Accepts a variable number of arguments. Minimum: 1.
Remarks
- The output has the maximum input column count.
- Scalar arguments are treated as 1x1 values.
- Missing columns in narrower inputs are padded with
#N/A. - Empty inputs are skipped; if all inputs are empty, result is an empty spill.
Examples
Join two equally sized rectangular arrays.
Formula =VSTACK({1,2;3,4},{5,6;7,8})
Expected result {1, 2; 3, 4; 5, 6; 7, 8}
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Join three arrays in their argument order.
Formula =VSTACK({1,2},{3,4},{5,6})
Expected result {1, 2; 3, 4; 5, 6}
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Pass the smallest array as the only argument.
Formula =VSTACK({42})
Expected result 42
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
A division-by-zero error is carried into the assembled output.
Formula =VSTACK(1/0)
Expected result #DIV/0!
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Join two 1-row ranges vertically
Formula =VSTACK(A1:B1,A2:B2)
| A | B | |
|---|---|---|
| 1 | 1 | 10 |
| 2 | 2 | 20 |
Expected result {1, 10; 2, 20}
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Stack scalar values
Formula =VSTACK(5,9)
Expected result {5; 9}
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Related functions
FAQ
How does VSTACK combine ranges of different widths?
The output uses the widest input and pads narrower inputs with #N/A.
What happens if all VSTACK inputs are empty ranges?
Empty inputs are skipped, and if every argument is empty the function returns an empty spill.