Skip to main content
Version: Streamsheets 3.0

STACK.ROTATE

This function rotates the complete stack by Pos positions up or down.

Syntax

=STACK.ROTATE(StackRange, [Position], TargetRange)

Arguments

NameTypeDescription
StackRangeRangeRange, where the source range items are added to. The first row of the StackRange is a title range and remains unchanged.
Position (optional)NumberIf Position equals 0 then stack is not rotated. If Position > 0 all rows are moved up and the first row becomes the last one (behind the last filled row in the range). If Position < 0 all rows move down and the last filled cell becomes the first row.

Default value: 1
TargetRangeRangeIf TargetRange is specified, the first row (after rotation) 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 rotated values are copied to the matching columns in the TargetRange. Important: Before copying to the TargetRange all existing values in TargetRange are deleted (not the labels row!).

Return

TypeDescription
Booelan or ErrorTRUE, if no error occurred, otherwise error value.

Examples

ABCD
1NameAgeCityStreet
2Maier43SidneyMain Street
3Miller53SidneySouth Street
4Jones45SidneyWest Street
5Maier35SidneyHigh Street
FormulaResultComment
=STACK.ROTATE(A1:D5, 1)
After calling STACK.ROTATE