sort_range
Sort a spreadsheet range or table by specified columns in ascending or descending order, with support for header rows and tie-breaking. Handles filtered hidden rows correctly.
Instructions
Sort a range or table body by one or more keys, writing the rows back reordered. keys is a list of {column, order}: header name, letter, or 1-based index; asc or desc; later keys break ties. has_header keeps the first row put. Moved formulas shift relative refs (Excel semantics); keys compare cached values, warning when uncalculated. Filter-hidden rows stay pinned and unsorted, as in Excel. Hazardous workbooks need allow_loss. Auto-backup (prev is the undo); atomic verified save. Refuses while open in Excel.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| keys | Yes | ||
| path | Yes | ||
| sheet | No | ||
| backup | No | ||
| location | Yes | ||
| allow_loss | No | ||
| has_header | No | ||
| verify_com | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||