What is the SORT function in Google Sheets?
SORT reorders rows from an input range and spills the result elsewhere. Source data stays put, unlike Data > Sort range which edits the grid in place. Use SORT on dashboard tabs when lists should refresh automatically. For menu-driven one-time sorts, see the sorting glossary term.
When to use it
Use SORT for live leaderboards, alphabetized pick lists, and chart sources that must always show newest dates or highest values first.
When to skip it
Skip SORT when you only need the top N rows. SORTN may be shorter. When row order in the source must stay fixed for IDs, sort on an output tab instead.
How it works
-
1
Pass the data range, including every column you want in the output.
-
2
Set sort_column to the 1-based index of the key column inside that range.
-
3
Set is_ascending TRUE for A-Z or low-to-high, FALSE for descending.
-
4
Add more sort_column and is_ascending pairs for secondary keys when needed.
-
5
Leave blank cells below and beside the formula for the spill range.
-
6
Wrap FILTER inside SORT when only a subset should be ordered.
Examples in Google Sheets
Newest first
=SORT(A2:E, 4, FALSE) orders rows by column 4 descending so recent dates float to the top.
Alphabetical directory
=SORT(Contacts!A2:C, 1, TRUE) lists names A-Z without touching the source tab.
Sorted active rows
=SORT(FILTER(Data!A:F, Data!F:F="Active"), 3, TRUE) filters then sorts by due date ascending.
Better Sheets resources
Common mistakes
-
Sorting only one column in place with the menu while SORT on another tab would preserve IDs.
-
Wrong sort_column index after inserting a column left of the key.
-
Sorting text that looks like numbers, so 10 appears before 2.
-
Placing the SORT formula over cells the spill would overwrite.
-
Confusing SORT with the sorting UI glossary page about Data menu behavior.
Frequently asked questions
- SORT vs Data > Sort range?
- SORT is a formula that outputs a sorted copy. The menu sorts the selected range in place.
- SORT vs sorting glossary term?
- This page is about the SORT() function. The sorting term covers UI sorts and general row-order habits.
- SORT vs SORTN?
- SORT returns all rows ordered. SORTN caps how many rows return after sorting.
- Multiple sort keys in SORT?
- Add extra sort_column and is_ascending argument pairs for tie breaking.
- SORT with headers?
- Exclude header rows from the range or they sort into the data as a text row.
- SORT dates?
- Works when dates are real values. Text dates sort alphabetically and mislead.
- SORT and FILTER together?
- Nest FILTER inside SORT or sort the FILTER output range for dynamic subsets.
- Does SORT break references?
- Source references stay stable because SORT writes to a spill, not the original rows.
Related Tutorials
Watch how SORT works
Search Every Function in Google Sheets
Scrape Google Maps
Advanced Coding in Google Sheets for Programmers
Calculate ROAS in Google Sheets
The First Thing I Do When Starting a Google Sheet
Related blog posts
Guides that explain SORT in more depth.
How to Use Google Sheets as a Website Database
Did you know you can use Google Apps Script to turn a Google Sheet into a free, auto-syncing database for your website? This guide shows you exactly how to set it up. You’ll prepare your spreadsheet, write a few lines of code and publish your site. Don’t worry if you’re not a developer, we’ll walk you through it. Why Use Google Sheets as a Database? For small projects, Google Sheets offers many advantages over traditional databases: * Free hosting and storage * Easy to edit data without...
Read post →The Most Popular Google Sheet Tutorial on the IF() Formula
The IF() formula is a logical function that makes it easy for users to compare a certain value and an expected value. It takes a look at a value to see if basic conditions are met.
Read post →Getting Started in Google Sheets Spreadsheet Management
Users can also customize the appearance of their spreadsheets with different fonts, colors, and themes.
Read post →Related terms
sorting data in Sheets
Sorting reorders rows by one or more columns. The Data > Sort range menu sorts selection in place. The SORT function returns a sorted copy that updates when inputs change. Always decide whether related columns must move together as a single row unit.
Read guide →SORTN
SORTN sorts a range and returns only the first N rows. You choose how many rows, which column drives the sort, and ascending or descending order. Leaderboards and best-seller reports use SORTN instead of manual sorting that goes stale.
Read guide →FILTER
FILTER returns only the rows from a range that meet one or more conditions. Conditions are boolean arrays the same height as the data. FILTER spills results automatically, so it replaced many INDEX/SMALL helper-column patterns for live subsets.
Read guide →UNIQUE
UNIQUE extracts a deduplicated list from a column or table. Optional arguments control whether duplicates appear by row, by column, or with occurrence counts. It powers dropdown source lists, category tabs, and data cleanup without manual copy-paste.
Read guide →Done reading about SORT?
Membership unlocks 600+ tutorials, unlimited generators, and every template. Practical lessons. Zero fluff.
Need this once
Jump to a free tool or a single tutorial for this topic.
Learning Sheets for real
Unlock the full library, generators, and templates with membership.