How to Use the SORT Function in Google Sheets

By Tomosuke Hasegawa · Updated Oct 29, 2026 · Beginner · 6 min read · includes 2 free exercises

In short: SORT returns a sorted copy of a range. The formula is =SORT(range, sort_column, is_ascending). Use TRUE for A to Z or smallest first, and FALSE for descending order.

SORT vs the sort menu

The Data menu sorts your cells in place. SORT leaves the original data alone and returns a sorted copy somewhere else. When the source changes, the sorted copy updates automatically, which makes SORT ideal for leaderboards and live reports.

SORT syntax

=SORT(range, sort_column, is_ascending, [sort_column2, is_ascending2, ...])

Only the columns you name decide the order. The other columns are returned in the order they originally appear.

A step-by-step example

Here are four names and scores in cells A1:B5.

AB
1NameScore
2Cara67
3Ann82
4Dev91
5Ben54
=SORT(A2:B5, 2, FALSE)

This returns the rows ordered by the second column, highest first: Dev 91, Ann 82, Cara 67, Ben 54. Here is why: the 2 means the second column of the range (Score), and FALSE means descending. To sort alphabetically by name instead:

=SORT(A2:B5, 1, TRUE)

This returns Ann, Ben, Cara, Dev with their scores attached.

Sort by two columns

Add another pair of arguments for ties. =SORT(A2:B5, 2, FALSE, 1, TRUE) sorts by score first and uses the name to break ties.

Common mistakes

Try it yourself

Use the table above (A1:B5). Type your formula into the box, starting with =, then press Check.

Exercise 1: Highest score first

Write a formula that returns A2:B5 sorted by the Score column, highest first.

Hint: Score is column 2 and descending is FALSE.

Exercise 2: A to Z by name

Write a formula that returns A2:B5 sorted alphabetically by name.

Hint: Name is column 1 and ascending is TRUE.

What to learn next

Syntax and rules in this guide were checked against Google's SORT help page. See all guides.