What you will build
Sort an order table without separating customers from their orders. This lesson uses fictional sample data so you can reproduce each action.
Learning objective
Complete the steps using the dataset below, explain why range sorting is used, and recognize issues when the wrong range, header setting, or sort column is chosen.
Prepare the sample data
Paste this example as tab-separated values beginning at A1 on a new worksheet:
Practice in your own copy
Make your own Google Sheets copy with the same data, formulas, formatting, filter and frozen header. The original remains unchanged.
Sign in to Google. If the original is not publicly shared, download the full workbook and import it into Google Sheets, or paste the example data into your own sheet.
Open the sample workbook in Google Drive (access required) ↗
Work through the example
Step 1: Select the full range A1:C5 so the blue selection covers Order, Customer and Amount together. Do not select only column C.
Step 2: With A1:C5 still selected, open the menu bar and click Data > Sort range > Advanced range sorting options.
Step 3: In the Sort range from A1 to C5 dialog, turn on Data has header row. Under Sort by, choose Column C (the Amount column), select Z to A, then click Sort.
Step 4: Check the table after sorting. Amount must be in descending order, and every Order ID must still be attached to the correct customer.
| Order | Customer | Amount |
|---|---|---|
| O-103 | Chi | 780 |
| O-101 | An | 450 |
| O-104 | Dung | 300 |
| O-102 | Binh | 120 |
This is the verified order after sorting Amount from Z to A; the values within each row must remain associated.
Checkpoint
| Order | Customer | Amount |
|---|---|---|
| O-101 | An | 450 |
| O-102 | Binh | 120 |
| O-103 | Chi | 780 |
| O-104 | Dung | 300 |
Each value must be in the intended column. If the entire dataset lands in one cell, undo, select A1, and paste the tab-separated data again.
Common mistake and correction
If the result is unexpected, confirm that the selected range is A1:C5, enable “Data has header row,” and sort by Amount from Z to A. Sorting only one column of a related table can corrupt row associations, so keep a stable Order ID to catch mismatches.
Independent practice
After following the example, complete this variation without editing the source data: Sort by Customer A–Z, then restore the order using the Order ID.
Key takeaways
- ✓Sort an order table without separating customers from their orders.
- ✓Select the entire table A1:C5, not just the Amount column.
- ✓Use Data > Sort range > Advanced range sorting options and enable Data has header row before choosing Column C and Z to A.
- ✓Sorting only one column of a related table can corrupt row associations. Keep a stable order ID to catch mismatches.
- ✓Sort by Customer A–Z, then restore the order using the Order ID.
Check your understanding
Answer four questions about the practice sheet.
Continue learning
Previous lesson: Format numbers and currencies; Next lesson: Filter a spreadsheet.