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:

HANDS-ON PRACTICE

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.

Make a Google Sheets copy (access required) ↗View original

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.

Initial Google Sheets table in A1:C5 with Order, Customer and Amount visible before sorting.

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.

Google Sheets with the complete range A1:C5 selected across Order, Customer and Amount.

Step 2: With A1:C5 still selected, open the menu bar and click Data > Sort range > Advanced range sorting options.

Google Sheets Data menu with Sort range expanded and Advanced range sorting options visible.

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.

Sort range dialog configured with Data has header row enabled, Column C selected and Z to A chosen.

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.

OrderCustomerAmount
O-103Chi780
O-101An450
O-104Dung300
O-102Binh120

This is the verified order after sorting Amount from Z to A; the values within each row must remain associated.

Order table sorted by Amount descending with all three columns visible and row relationships preserved.

Checkpoint

OrderCustomerAmount
O-101An450
O-102Binh120
O-103Chi780
O-104Dung300

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.
QUICK CHECK

Check your understanding

Answer four questions about the practice sheet.

1. Which first action belongs to this lesson?
2. Which follow-up action belongs to the lesson?
3. Which precaution matters for this lesson?
4. What is the independent practice task?

Continue learning

Previous lesson: Format numbers and currencies; Next lesson: Filter a spreadsheet.