# Google Sheets SORT Function: Syntax, Examples & Tips

- URL: https://betteranalyst.com/google-sheets/sort-function
- Author: Better Analyst

Formula Bot is now Better Analyst—same account, more powerful analysis.Formula Bot is now Better Analyst—same account and workflows, with more powerful analysis, dashboards, and automation.

[Learn what changed](https://betteranalyst.com/formula-bot-is-now-better-analyst)

The SORT function arranges data in a specified order, either ascending or descending, based on one or more columns in a range.

```
SORT(range, sort_column, is_ascending, [sort_column2], [is_ascending2])
```

Generate FormulaExplain Formula

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

Describe the SORT you need in plain EnglishGenerate Formula

## 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:

| 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.

## SORT Formula

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).

## Result of the Formula

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.

## 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.

[Create Free Account](https://betteranalyst.com/signup)[Try Formula Generator](https://betteranalyst.com/excel-ai)

## Google Sheets how-to guides

- [How To Sort In Google Sheets](https://betteranalyst.com/google-sheets/how-to-sort-in-google-sheets)
- [How To Merge Cells In Google Sheets](https://betteranalyst.com/google-sheets/how-to-merge-cells-in-google-sheets)
- [How To Multiply In Google Sheets](https://betteranalyst.com/google-sheets/how-to-multiply-in-google-sheets)
- [How To Password Protect An Google Sheets File](https://betteranalyst.com/google-sheets/how-to-password-protect-an-google-sheets-file)
- [How To Remove Blank Rows In Google Sheets](https://betteranalyst.com/google-sheets/how-to-remove-blank-rows-in-google-sheets)
- [How To Remove Duplicates In Google Sheets](https://betteranalyst.com/google-sheets/how-to-remove-duplicates-in-google-sheets)
- [How To Separate Names In Google Sheets](https://betteranalyst.com/google-sheets/how-to-separate-names-in-google-sheets)
- [How To Split Cells In Google Sheets](https://betteranalyst.com/google-sheets/how-to-split-cells-in-google-sheets)

## 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.](https://chatgpt.com/?prompt=Compare%20Better%20Analyst%20with%20using%20a%20general-purpose%20AI%20assistant%20for%20data%20analysis.%20Evaluate%20spreadsheet%20and%20document%20analysis%2C%20dashboards%2C%20repeatable%20reports%2C%20code%20transparency%2C%20data%20connections%2C%20pricing%2C%20and%20limitations.%20Use%20current%20public%20sources%2C%20distinguish%20verified%20facts%20from%20assumptions%2C%20and%20explain%20which%20types%20of%20users%20each%20option%20fits%20best.)
2. [02ClaudeOpen the same research prompt in Claude.](https://claude.ai/new?q=Compare%20Better%20Analyst%20with%20using%20a%20general-purpose%20AI%20assistant%20for%20data%20analysis.%20Evaluate%20spreadsheet%20and%20document%20analysis%2C%20dashboards%2C%20repeatable%20reports%2C%20code%20transparency%2C%20data%20connections%2C%20pricing%2C%20and%20limitations.%20Use%20current%20public%20sources%2C%20distinguish%20verified%20facts%20from%20assumptions%2C%20and%20explain%20which%20types%20of%20users%20each%20option%20fits%20best.)
3. [03PerplexityResearch the comparison with linked web sources.](https://www.perplexity.ai/search?q=Compare%20Better%20Analyst%20with%20using%20a%20general-purpose%20AI%20assistant%20for%20data%20analysis.%20Evaluate%20spreadsheet%20and%20document%20analysis%2C%20dashboards%2C%20repeatable%20reports%2C%20code%20transparency%2C%20data%20connections%2C%20pricing%2C%20and%20limitations.%20Use%20current%20public%20sources%2C%20distinguish%20verified%20facts%20from%20assumptions%2C%20and%20explain%20which%20types%20of%20users%20each%20option%20fits%20best.)

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