Skip to main content
Version: Streamsheets 2.5

STACKADD

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 STACKADD. 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 STACKADD function automatically indexes the added items in the correct columns.

Syntax

=STACKADD(StackRange, SourceRange, [Direction], [TargetRange])

Arguments

NameDescription
StackRangeRange, where the source range items are added to. The first row of the StackRange is a title range and remains unchanged.
SourceRangeRange, 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)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. By default Direction is TRUE.
TargetRange (optional)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

TRUE, if no error occurred, otherwise error value.

Examples

FormulaResultComment
=STACKADD(A5:D9,A2:D3,TRUE) 
After calling STACKADD the first time: