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.
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.
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.
Imagine you are managing a list of students and their grades stored in a Google Sheets document:
| StudentID | StudentName | Grade |
|---|---|---|
| 1 | Alice | 85 |
| 2 | Bob | 92 |
| 3 | Charlie | 78 |
You want to sort this table by the Grade in descending order to see which students performed the best.
To achieve this, you would use the SORT function as follows:
=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).When you apply the SORT formula to the Students Table, the output would look like this:
| StudentID | StudentName | Grade |
|---|---|---|
| 2 | Bob | 92 |
| 1 | Alice | 85 |
| 3 | Charlie | 78 |
The students are now listed from highest to lowest grade, making it easy to identify top performers.
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.
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!
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.
Sign up for Better Analyst and get unlimited AI-powered formula generation, explanations, and advanced data analysis.
Browse our complete library of Google Sheets formula guides
Compare your options
Open a neutral research prompt in the AI tool you already use. Compare capabilities, limitations, and fit before you choose.
AI answers can be incomplete. Check source links, current pricing, and product documentation before deciding.