0
0
Google Sheetsspreadsheet~10 mins

Sorting (single and multi-column) in Google Sheets - Cell-by-Cell Formula Trace

Choose your learning style9 modes available
Sample Data

This table shows a list of people with their Age and Score.

CellValue
A1Name
B1Age
C1Score
A2Alice
B230
C285
A3Bob
B325
C390
A4Charlie
B430
C475
A5Diana
B525
C595
Formula Trace
=SORT(A2:C5, 2, TRUE, 3, FALSE)
Step 1: Range to sort: A2:C5
Step 2: Sort by column 2 (Age) ascending
Step 3: Within same Age, sort by column 3 (Score) descending
Step 4: Final sorted array
Cell Reference Map
    A       B       C
1 | Name  | Age   | Score
2 | Alice | 30    | 85   
3 | Bob   | 25    | 90   
4 | Charlie| 30   | 75   
5 | Diana | 25    | 95   

Formula references range A2:C5 for sorting by columns B and C.
The formula uses the data in cells A2 to C5. It sorts by column B (Age) ascending, then by column C (Score) descending.
Result
    A       B       C
1 | Name  | Age   | Score
2 | Diana | 25    | 95   
3 | Bob   | 25    | 90   
4 | Alice | 30    | 85   
5 | Charlie| 30   | 75   

The sorted result shows Diana first because she has the lowest Age (25) and highest Score (95) among age 25.
The sorted table shows names ordered by Age ascending and Score descending within the same Age.
Sheet Trace Quiz - 3 Questions
Test your understanding
What is the first row after sorting with =SORT(A2:C5, 2, TRUE, 3, FALSE)?
ABob, 25, 90
BDiana, 25, 95
CAlice, 30, 85
DCharlie, 30, 75
Key Result
SORT(range, sort_column1, ascending1, sort_column2, ascending2) sorts data by multiple columns in specified order and directions.