Array Functions
Intermediate

SORT whole rows by one column

Sort the table, not just the numbers, so names stay with their figures.

Task:

Build a leaderboard that keeps each rep's name and region beside their sales. In E2, sort the whole table A2:C7 by sales, highest first.

Interactive Spreadsheet

Hints

+5 XPno-hints bonus

Solve it on your own to keep the bonus. Each hint gets one step closer to the formula.

The data in this exercise

This is the grid you start with. Cell references in the task — B6, C2 — point at the row numbers and column letters below.

7 rows × 7 columns7 cells you fill in
ABCDEFG
1RepRegionSalesRepRegionSales
2MiaNorth41200
3NoahSouth52800
4OluEast38600
5PiaNorth60100
6RafWest47500
7SiaSouth55300
What this exercise teachesMay contain the answer

Sorting only the sales column produces numbers with no names attached. Passing the whole table keeps every row together, and the sort_index picks which of its columns decides the order. The source stays exactly as it was.