Google Sheets SORT Function: Syntax, Examples & Tips

The SORT function arranges data in a specified order, either ascending or descending, based on one or more columns in a range.
Google Sheets
SORT(range, sort_column, is_ascending, [sort_column2], [is_ascending2])

One free generation or explanation per browser, shared across Excel and Google Sheets. Account usage limits apply afterward.

On this page
  1. Parameters
  2. What is the SORT Function?
  3. A Practical Example
  4. SORT Formula
  5. Result of the Formula
  6. Why Use SORT?
  7. Key Takeaways:
  8. Example use case

Parameters

range:
The range of cells that you want to sort.

sort_column:
The column number in the range that you want to sort by. This is a 1-based index.

is_ascending:
A boolean value (TRUE or FALSE) that determines the sort order. TRUE sorts in ascending order, while FALSE sorts in descending order.

sort_column2:
(Optional) The column number in the range that you want to sort by as a secondary sort. This is also a 1-based index.

is_ascending2:
(Optional) A boolean value (TRUE or FALSE) that determines the sort order for the secondary sort. TRUE sorts in ascending order, while FALSE sorts in descending order.

What is the SORT Function?

The SORT function in Google Sheets is a useful tool that allows users to organize their data in a specific order, either ascending or descending. This function can sort data based on one or more columns, making it easier to analyze and interpret information. It is particularly helpful when dealing with large datasets, as it enables quick organization without altering the original data.

In simpler terms, the SORT function helps you arrange your data in a way that makes it easier to read and understand.

A Practical Example

Imagine you are managing a list of students and their grades stored in a Google Sheets document:

Students Table:

StudentIDStudentNameGrade
1Alice85
2Bob92
3Charlie78

You want to sort this table by the Grade in descending order to see which students performed the best.

SORT Formula

To achieve this, you would use the SORT function as follows:

Google Sheets
=SORT(A2:C4, 3, FALSE)

In this formula:

  • A2:C4 is the range of the data you want to sort.
  • 3 indicates that you want to sort by the third column (Grade).
  • FALSE specifies that you want the sorting to be in descending order (use TRUE for ascending order).

Result of the Formula

When you apply the SORT formula to the Students Table, the output would look like this:

StudentIDStudentNameGrade
2Bob92
1Alice85
3Charlie78

The students are now listed from highest to lowest grade, making it easy to identify top performers.

Why Use SORT?

SORT is beneficial because it provides a straightforward way to organize data, enhancing readability and analysis. It allows users to quickly rearrange their datasets without the need for manual sorting, saving time and reducing the risk of errors.

Key Takeaways:

  • SORT: A Google Sheets function that organizes data in a specified order.
  • Flexible: Can sort by one or multiple columns, accommodating various data structures.
  • Easy to Use: Simplifies the sorting process, making data management more efficient.
  • Common Use Cases: Ideal for organizing lists, ranking data, and preparing reports.

The SORT function is an essential tool for anyone working with data in Google Sheets, providing a powerful way to enhance data organization and clarity.

Happy spreadsheeting!

Example use case

You have a sales report with Column A listing product names and Column B showing sales figures. By using the SORT formula, you can quickly arrange the products by sales figures in descending order, allowing for easy identification of top-selling items.

Need more help with Google Sheets formulas?

Sign up for Better Analyst and get unlimited AI-powered formula generation, explanations, and advanced data analysis.

Explore all Google Sheets formulas

Browse our complete library of Google Sheets formula guides

Compare your options

Decide with evidence, not a sales pitch.

Open a neutral research prompt in the AI tool you already use. Compare capabilities, limitations, and fit before you choose.

  1. 01ChatGPTOpen a balanced comparison prompt in ChatGPT.
  2. 02ClaudeOpen the same research prompt in Claude.
  3. 03PerplexityResearch the comparison with linked web sources.

AI answers can be incomplete. Check source links, current pricing, and product documentation before deciding.