STACK.ADD
This function adds the cells in a SourceRange to a StackRange.The Stack range is a range of cells on the sheet <Streamsheet>
, which will be filled by using STACK.ADD. If the range is filled with cells, the existing cells will be moved defined by the direction parameter and the new cells will be added to the list. Values added to the StackRange have to use identical headers in both the Stack- and SourceRange. The STACK.ADD function automatically indexes the added items in the correct columns.
Syntax
=STACK.ADD(StackRange, SourceRange, [Direction], [TargetRange])
Arguments
Name | Type | Description |
---|---|---|
StackRange | Range | Range, where the source range items are added to. The first row of the StackRange is a title range and remains unchanged. |
SourceRange | Range | Range, where the source data is taken from and copied into the StackRange.The first row of the StackRange is a title range and remains unchanged. |
Direction (optional) | Boolean | If you set Direction to TRUE the new data is added behind the last empty row on the SourceRange. If the StackRange is full, the first row (after the columns row) is dropped from the stack and all rows move up to make room for the new data in the last row. Analog, if Direction is set to FALSE rows are added at top of the stack and dropped from the bottom. Default value: TRUE |
TargetRange (optional) | Range | If TargetRange is specified and if a row has to be dropped, the row is copied to the TargetRange. TargetRange must have two rows, the first row has labels also found in Stackrange (not necessarily all and maybe not in the same order!). The dropped values are copied to the matching columns in the TargetRange. If no row is dropped, the values in the second row of TargetRange are blanked out. Important: Before copying to the TargetRange all existing values in TargetRange are deleted (not the labels row!) |
Return
Type | Description |
---|---|
Boolean or Error | TRUE, if no error occurred, otherwise error value. |
Examples
A | B | C | D | |
---|---|---|---|---|
1 | Name | Age | City | Street |
2 | Maier | 43 | Sidney | Main Street |
3 | ||||
4 | Name | Age | City | Street |
5 |
Formula | Result | Comment |
---|---|---|
| After calling STACK.ADD the first |