SORT in WPS Spreadsheet: Order Complete Records by One Column
Sort WPS records by an explicit numeric column and direction while retaining row relationships and version-specific array-entry guidance.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: =SORT(A2:C5,3,-1) orders the rows of A2:C5 by its third column, descending. It returns a sorted result; the source table remains the input.
Availability and evidence scope
The official WPS SORT lesson documents the behavior used here. It identifies WPS Office for Windows Personal. Reviewed October 19, 2026, this Chinese-language evidence does not establish an exact introduction build, every current edition, or English-global, Mac, Linux, web or mobile behavior. No new WPS execution or native screenshot was possible; the examples are independent controls or explicitly conditional fixtures.
Historical entry method versus newer releases
The 2021 lesson demonstrates selecting the complete result range, entering the formula and pressing Ctrl+Shift+Enter. Braces shown around an array formula are added by that workflow; do not type them as part of the formula. That historical method is the reproducible workflow described here.
The official Windows release log separately announces dynamic arrays in October 2023. Consequently, the older lesson’s no-dynamic-array statements are historical, not a claim that current WPS cannot expand array results. For a newer installation, confirm its array-entry behavior and available output space in that build. This guide does not import Excel spill rules, error codes, spill-reference operators or cross-workbook behavior into WPS. Monthly release notes do not establish an exact introduction build for SORT.
Syntax and arguments
=SORT(array,sort_index,sort_order,[by_col])
The source lists array, sorting basis, order and by-column direction. Its row-sorting demonstration omits the fourth argument, as do the examples here. This signature intentionally keeps the key and order explicit rather than asserting undocumented defaults.
arrayis the complete block to return.sort_indexis the key’s position within that block. A third column is 3 even if the block begins in a different worksheet column.sort_orderis 1 for ascending or -1 for descending, as demonstrated by WPS.by_colselects a column-oriented arrangement; this guide does not exercise that mode or assume its full contract from another product.
Example 1: rank inventory by quantity
Enter this source in A1:C5:
| Row | A: Item | B: Zone | C: Quantity |
|---|---|---|---|
| 2 | Bolt | North | 12 |
| 3 | Clip | South | 7 |
| 4 | Nut | West | 20 |
| 5 | Washer | East | 4 |
For the historical workflow, select E2:G5, enter =SORT(A2:C5,3,-1) and confirm with Ctrl+Shift+Enter. The independently expected result is:
| Item | Zone | Quantity |
|---|---|---|
| Nut | West | 20 |
| Bolt | North | 12 |
| Clip | South | 7 |
| Washer | East | 4 |
The numerical control is 20 > 12 > 7 > 4. Each zone stays paired with its original item. Sorting only C2:C5 would return quantities without the identities needed to interpret them.
Example 2: show the lowest stock first
In a separate 4-by-3 output area, use =SORT(A2:C5,3,1). The expected order is Washer, Clip, Bolt, Nut, with quantities 4, 7, 12, 20. This makes a compact replenishment review without changing the entered inventory table.
If the returned block were B2:C5 instead, quantity would be its second column: =SORT(B2:C5,2,1). The expected pairs would be East/4, South/7, North/12 and West/20. This illustrates why the index follows the return block rather than the worksheet’s column letters.
Troubleshooting and limits
- Exclude the header: A2:C5 contains records; A1:C5 also contains labels that are not inventory.
- Check that quantities are actual numeric inputs. The examples do not claim mixed number/text sorting behavior.
- Avoid tied keys when validating the first test. Tie ordering is not established by these distinct-key fixtures.
- If the selected legacy output is too small, correct the output range before treating missing rows as a data problem.
- Do not assume the 2021 multi-key array-constant example establishes every modern WPS sort feature. This guide validates one key at a time.
Use SORTBY when the sorting key is a separate aligned range, including when it should not appear in the result. Use FILTER to choose which records qualify before tackling ordering. The two problems are different: sorting does not remove unwanted records.
References and verification
Expected outputs are derived from the explicit fixtures and documented operation. They are not results observed in an installed WPS build. Check the intended edition before relying on these formulas in a shared workbook.