Skip to main content
googleSheets.sortRange rearranges rows within a structured range using one or more sort keys.

Example

Inputs

Provide spreadsheet, one-based structured range, and non-empty sortBy. Each sort column is an absolute one-based sheet column, not relative to the range. Direction defaults to ascending. Second argument { account } selects the Google Account.

Output

Returns the resolved zero-based grid range. Exclude a header row from range when it should remain fixed.