Syntax
=VSTACK(array1, [array2], ...)Arguments
| Argument | Required | Description |
|---|---|---|
array1 | Required | A range or array |
array2 | Optional | More ranges or arrays |
How to use VSTACK
When VSTACK returns more than one value, the result spills into the cells below and to the right. Keep those cells empty, or you get #SPILL!.
VSTACK takes 1 required argument and 1 optional argument, and accepts more values in the same pattern. Type =VSTACK( in a cell and SheetsBat shows the arguments as you go. Optional arguments are shown in square brackets; leave them out to use their default.
Examples
Each result below was calculated by the SheetsBat formula engine.
=VSTACK({1,2}, {3,4})Result Spilled result
| A | B | |
|---|---|---|
| 1 | 1 | 2 |
| 2 | 3 | 4 |
=VSTACK({1,2}, 3)Result Spilled result
| A | B | |
|---|---|---|
| 1 | 1 | 2 |
| 2 | 3 | #N/A |
Related array functions
- SORTBYSorts a range or array by the values of other ranges or arrays.
- SORTNReturns the first n rows of a range after sorting, with options for ties.
- TAKEReturns a number of rows or columns from the start (positive) or end (negative) of an array.
- TOCOLReturns the values of an array as a single column.
- TOROWReturns the values of an array as a single row.
- TRIMRANGERemoves empty rows and columns from the edges of a range.
- UNIQUEReturns the unique rows (or columns) of a range or array.
- WRAPCOLSWraps a row or column of values into columns of the given length.
- WRAPROWSWraps a row or column of values into rows of the given length.