The ability to quickly and easily sort large amounts of data is one of the most useful things about spreadsheets.

There are a number of ways to do this. Here you’ll learn about the SORT function.

SORT

This function takes in data and sorts it by one or more of the columns present. You can also sort data by referencing an external column.

Syntax

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

By default the SORT function assumes sort_column = 1 and is_ascending = TRUE. If that’s the case for your data you can leave these arguments out of the function.

Example

Here’s some data:

AB
1NameAge
2Jane32
3James56
4John24
5Julia33

Let’s sort the data by name:

=SORT(A2:B5,1,TRUE)
CD
1NameAge
2James56
3Jane32
4John24
5Julia33

By age:

=SORT(A2:B5,2,TRUE)
CD
1NameAge
2John24
3Jane32
4Julia33
5James56

Or just the names, but descending by age:

=SORT(A2:A5,B2:B5,FALSE)
E
1Name
2James
3Julia
4Jane
5John

It’s a powerful function with a lot of options.

Sorting Data Exercises
Enter a formula for each question in the formula bar for the spreadsheet below to access the next lesson.
1. Alphabetical
In cell A9, enter a formula that sorts both the first and last names alphabetically (A-Z) by only the first names.
2. Order
In cell C9, enter a formula that sorts the sales numbers by the first names alphabetically (A-Z).
ABC
1FirstLastSales
2DwightSchrute10,000
3JimHalpert8,000
4StanleyHudson7,000
5PhyllisVance6,000
6AndyBernard4,000
7
8FirstLastSales
9
10
11
12
13
14
Next Lesson

FREE RESOURCE

Google Sheets Cheat Sheet

Learn 12 tips and tactics that will make your sheets more beautiful and user-friendly from today.

Google Sheets Cheat Sheet

By entering your email address you agree to get email updates from me. I'll respect your privacy and you can unsubscribe at any time.