Google Sheets Formula Ascending Order: How to Sort
In this article
To sort data in ascending order with a Google Sheets formula, use SORT. The simplest version is =SORT(A2:B10, 1, TRUE), which returns the range A2:B10 sorted by the first column from smallest to largest. If you want to sort by a different column, change the second argument to that column's number within the range (1 for the first column, 2 for the second, and so on). The third argument TRUE means ascending; use FALSE for descending. This formula creates a new sorted view without changing your original data, so it is safe and reversible.
What You'll Need
- A Google account and access to Google Sheets (desktop browser or mobile app).
- Your data entered in a sheet, ideally with a header row and no completely blank rows inside the range.
- An empty area or a new sheet where the sorted result can appear (the formula needs room to spill).
Step-by-Step
- Open your sheet and identify the range. Select the cells you want to sort, or note the range address (for example, A1:C20). Include headers if you want them repeated in the result; if you include headers, you will tell the formula to treat the first row as labels.
- Choose an empty cell for the formula. Click a cell where there is enough empty space below and to the right for the sorted data to appear. For example, click cell E1 on the same sheet or switch to a new sheet.
- Type the SORT formula. Enter
=SORT(range, sort_column, is_ascending, [sort_column2, is_ascending2, ...]). For a basic ascending sort by the first column of range A2:B10, type=SORT(A2:B10, 1, TRUE). Press Enter. - Check the result. The sorted data should appear starting in the cell where you typed the formula and spill into the cells below and to the right. If you see a #REF! error, the spill area is blocked; clear the cells below or move the formula.
- Sort by a different column. If your range is A2:C10 and you want to sort by column C (the third column in the range), use
=SORT(A2:C10, 3, TRUE). The column number is counted from the left edge of the range, not from column A of the sheet. - Add a second sort level (optional). To sort by column 1 ascending and then by column 2 ascending, use
=SORT(A2:C10, 1, TRUE, 2, TRUE). The formula pairs each sort column with its ascending/descending setting. - Include headers correctly. If your range includes a header row (for example, A1:C10), you can still sort it. The SORT function does not automatically treat the first row as a header; it will sort the header along with the data unless you exclude it. The safest approach is to sort only the data rows (A2:C10) and keep your header row outside the range. Alternatively, if you want the header included in the output, you can wrap SORT with other functions, but for most users, sorting the data range without the header is simpler and avoids the header being sorted into the middle of the data.
- Use SORT with FILTER for dynamic data (optional). If you want to sort only rows that meet a condition, combine SORT with FILTER:
=SORT(FILTER(A2:C10, B2:B10>100), 1, TRUE). This sorts the filtered rows by the first column ascending. - Copy or convert to values if needed. The SORT formula is dynamic: if the source data changes, the sorted result updates. If you need a static sorted list, copy the result and use Paste special > Values only to replace the formula with fixed values.
Common Mistakes
- Including the header row in the range. SORT will treat the header as data and may place it in the middle of the sorted list. Sort only the data rows, or use a formula that explicitly excludes the header.
- Using the wrong column number. The sort column is relative to the range, not the sheet. If your range starts at column B, then column 1 is B, column 2 is C, and so on.
- Forgetting the is_ascending argument. SORT requires the third argument. Use TRUE for ascending, FALSE for descending. Omitting it causes an error.
- Blocked spill range. If any cell in the area where the result should appear already contains data, you get a #REF! error. Clear the area or move the formula.
- Sorting text that looks like numbers. Numbers stored as text may sort differently (for example, "10" before "2"). Ensure your data is formatted as numbers if you expect numeric sorting.
Tips
- Use a separate sheet for sorted views to keep your raw data untouched.
- Combine SORT with UNIQUE to remove duplicates and sort:
=SORT(UNIQUE(A2:A100), 1, TRUE). - For simple one-off sorts, you can also use the Data > Sort range menu, but the formula approach is better when you want the sorted result to update automatically.
- If you need to sort by multiple columns with mixed directions, list each column and its TRUE/FALSE setting in order.
- Remember that SORT returns an array; you cannot edit individual cells in the result without converting to values first.
Troubleshooting
- #REF! error: The spill range is not empty. Clear the cells below and to the right of the formula, or move the formula to an empty area.
- #VALUE! error: Check that the range is valid and that the sort column number is within the range's width. Also ensure is_ascending is TRUE or FALSE.
- #NAME? error: The function name may be misspelled. Use SORT, not SORTED or other variants.
- Header appears in the middle: You included the header row in the range. Adjust the range to start from the first data row.
- Sorting seems wrong: Check for leading spaces, numbers stored as text, or hidden characters. Use TRIM or clean the data if needed.
- Formula not updating: Ensure calculation is set to automatic (File > Settings > Calculation). If you copied the formula as values, it will not update.
Frequently Asked Questions
Can I sort ascending without a formula?
Yes. Select your data, then use Data > Sort range and choose ascending order. This changes the original data, while the SORT formula creates a new sorted view.
Does SORT work on mobile?
Yes, the SORT function works in the Google Sheets mobile app, but typing complex formulas is easier on a computer. The menu labels may differ slightly by version and device.
How do I sort by multiple columns ascending?
Use additional pairs of arguments: =SORT(A2:C10, 1, TRUE, 2, TRUE) sorts by column 1 ascending, then column 2 ascending.
Can I sort a filtered range?
Yes. Wrap FILTER inside SORT: =SORT(FILTER(A2:C10, B2:B10>100), 1, TRUE). The result will be sorted and will update if the filter condition changes.
Why does my header row get sorted?
SORT treats the entire range as data. Exclude the header by starting the range at the first data row (for example, A2 instead of A1).
Is SORT available in all Google Sheets versions?
SORT is a standard function in Google Sheets and works in all current versions. If you do not see it, check that you are using Google Sheets and not another spreadsheet app.