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

Example

Inputs

spreadsheet, one-based structured range, and non-empty sortBy are required. Each sort column is an absolute one-based sheet column, not relative to the range; direction defaults to ascending. account selects the Google account.

Output

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