Yes. Google Sheets can keep a separate, formula-generated view sorted as your data changes; to automatically reorder the original rows when someone edits them, you need a Google Apps Script. The built-in sort and filter tools are useful, but they do not provide a native “keep this sheet automatically sorted” switch.
What “auto sort” means in Google Sheets
People use “auto sort” to mean two different things. One is a sorted display that refreshes when the underlying data changes. The other is having the rows in the original table physically move into a new order after each edit. Google Sheets can do the first with a formula. The second generally requires scripting, because the normal sort command runs when a person chooses it rather than continuously in the background.
The distinction matters when other people enter or update information. A live sorted display is convenient for reading, but it is separate from the entry table. An automatic script can move the actual rows, but that can be disorienting if someone is editing a row at the same time. Before choosing a method, decide whether you need a tidy view, or whether the source table itself must always be ordered.
For example, a task list might have task names, due dates, and owners. A sorted view can show the nearest due dates first without changing where anyone enters a task. A script can instead reorder the task rows in the source list whenever a user edits the sheet. These approaches solve related but different problems.
Keep a sorted view updated with SORT
The simplest way to get a view that updates automatically is the Google Sheets SORT function. Enter the formula in an empty area or on a separate tab, and it returns the source rows in the order you specify. When the source values change, Sheets recalculates the result. The formula does not rearrange the original table.
For example, assume A1:C1 contains the headers Task, Due date, and Owner, and rows A2:C4 contain three tasks, their due dates, and owners. Put this formula in E1 or in cell A1 of a separate view tab to sort the data by the second column, due date, earliest first: =SORT(A1:C4,2,TRUE). The returned result includes the header row, so in a real setup it is usually better to keep the header outside the formula range and add it separately. With the data only in A2:C4, use =SORT(A2:C4,2,TRUE); the three returned rows will appear in ascending order by due date.
In Google Sheets, the second argument identifies the sort column within the selected range, and TRUE requests ascending order. Use FALSE for descending order. To sort by a second key, SORT accepts additional column-and-order arguments; for example, you can sort by due date and then by task name when dates tie. Make sure the formula’s output area is empty, because the results need room to expand. A value or another formula blocking that area causes an expansion error.
A formula-driven view is a strong choice when people should continue entering data in one stable location. It can also be useful for dashboards and read-only summaries. Readers can inspect or filter the displayed results without accidentally changing the source order. Remember, however, that changes made in the displayed output are not edits to the source rows; update the original table instead.
Sort the original rows manually
If you want to reorder the existing table, use a built-in sort. Select the data range, including all columns that belong to each record, then choose Data > Sort range > Advanced range sorting options. If the selected range has a header row, indicate that the data has a header row, then choose the column and ascending or descending order. For a whole-sheet sort, use Data > Sort sheet and choose the relevant column.
Sorting the complete set of columns is essential. If a table has a person’s name in column A and that person’s phone number in column B, sorting only column A can detach names from their phone numbers. Sheets may prompt you to expand the selection when it detects adjacent data. Check that the whole record is included rather than sorting a single column by itself.
This is a one-time action, not auto sort. If someone later changes a due date, the row stays where it is until a user sorts again. Manual sorting is often safer for shared data because the editor controls when rows move, and it requires no script permissions or maintenance.
Use filters and filter views for flexible browsing
A filter lets users hide rows that do not match selected conditions and sort the remaining records from the column menus. To add one, select the table and choose Data > Create a filter. Filter controls appear in the header row. They are useful for tasks such as showing only open jobs, filtering to one department, or sorting a visible list by a date.
Filters are not a rule that permanently maintains a sort order after every edit. They provide an interactive way to inspect and sort data. For shared sheets, a filter view can be less disruptive than changing the filter everyone sees. Choose Data > Filter views > Create new filter view, then set the filter or sort options in that view. Filter views let people explore a dataset without imposing the same temporary view on every collaborator.
For instance, a team can keep its task table in a stable entry order while one person uses a filter view to see overdue work and another uses a different view to review tasks assigned to them. If the goal is an automatically refreshed, permanently sorted display, a SORT formula is usually a closer match. If the goal is to explore and narrow a shared list, filters are often more practical.
Automatically reorder the source with Apps Script
To move the actual rows automatically, a spreadsheet owner or editor can add a script through Extensions > Apps Script. A simple edit-trigger function can check which sheet was edited and sort a defined data range by a chosen column. For example, a task sheet could be set to sort its data rows by the due-date column in ascending order after edits. This is not a built-in sort setting; it is custom automation that someone must configure and maintain.
A reliable script needs a clearly defined sheet name, header row, data range, and sort column. It should sort all columns in each record together, not just the key column. It also needs to account for the sheet’s actual structure: a fixed range may miss new rows, while a range based on the last used row can include stray content if someone has typed far below the table. Test the logic on a copy before relying on it for important or shared data.
Automatic reordering has usability costs. If a person edits a task’s due date, its row may move as soon as the edit is committed. The editor can then lose their place or find the row under a different screen position. In a collaborative sheet, two people may also be working in the same area as a sort occurs. Consider whether an explicit sort button, menu command, or formula-based view would be less surprising.
Script triggers also have limits and setup details. A simple on-edit trigger responds to user edits; it is not a general-purpose watcher for every possible change, such as a value changing solely because a formula recalculated. More advanced automation may require an installable trigger and authorization. Apps Script behavior can be affected by permissions and trigger execution limits, so a script should not be treated as a guaranteed, instantaneous database rule.
Choose the method that fits your sheet
The right option depends on who edits the data and what they expect to happen. Use a formula when you want a live sorted copy and a stable source table. Choose a manual sort when someone deliberately decides it is time to reorder the source. Use filter views when collaborators need different ways to browse one dataset. Reserve Apps Script for cases where the original rows truly must move automatically and the team understands that behavior.
- Live display, unchanged source: Use SORT on a separate tab or empty area.
- One-time reordering: Use Data > Sort range or Data > Sort sheet and include complete records.
- Personal or temporary views: Use a filter or filter view rather than continually rearranging the source.
- Automatic movement of original rows: Use a carefully scoped Apps Script trigger, and test it with a copy first.
Also consider whether sorting is actually the best way to organize the data. If users need to preserve the order in which records were added, add a timestamp or sequence field and sort a separate view by that field when needed. If entries belong in a specific workflow order, a status column plus filter views may be clearer than a sheet that rearranges itself after each edit.
Common problems and misconceptions
A frequent misconception is that adding a filter makes a sheet permanently auto-sort. A filter exposes sorting and filtering controls, but a user still needs to choose a sort, and later edits do not turn it into a continuous automatic sort rule. Likewise, a SORT formula updates a displayed result, not the order of the source records. Being clear about that difference prevents people from typing into the wrong place or expecting the source table to move.
Another common issue is including a header in a formula’s sort range. If the header is treated as an ordinary value, it may be sorted along with the records. Keep headers separate, or deliberately include them in a way that preserves their position. Blank rows and incomplete records can also make a result look odd, particularly when an open-ended range includes many empty cells. Use a range that reflects the data, and decide how incomplete rows should be handled.
With a script, the common failure is sorting the wrong range or sorting only the key column. Confirm the sheet name, header row, data width, and sort-column number. Another concern is that an edit can trigger a reorder while a person is entering information. Explain the behavior to collaborators and consider limiting the trigger to edits in relevant columns. If the requirement is simply to make the latest information easy to find, a separate sorted view is usually less disruptive.
How Google Sheets differs from Excel
The general distinction between a sorted formula result and sorting the original data also applies in Excel, but menu names and formula details differ between the programs. This page describes Google Sheets in a web browser: its sort commands are under the Data menu, and its SORT function uses Google Sheets’ own argument format. Do not assume that a formula copied from Sheets will behave identically in Excel, or that Excel’s menus match Sheets’ menus.
In either program, a formula-generated sorted result is conceptually different from a command that rearranges source rows. If a workbook or sheet is shared between platforms, check formulas and automation in the actual application where people will use it. Google Apps Script is designed for Google Workspace; it is not the same as Excel VBA or Office Scripts. A requirement to keep source rows sorted should be evaluated against the platform, permissions, and collaboration habits involved.
Frequently Asked Questions
Can Google Sheets automatically sort when I add a new row?
Not as a built-in setting for the original table. A SORT formula can include new data if its range covers it, while an Apps Script trigger can be configured to reorder the source rows after edits. A normal manual sort does not automatically repeat when a row is added.
Does the SORT formula change my original data?
No. It returns a sorted result in the cells where the formula is placed. The source range remains in its original order, and edits should be made in that source range rather than in the formula output.
Can I automatically sort by two columns?
Yes. Google Sheets SORT supports multiple sort-column and ascending-or-descending pairs. For example, a view can sort first by due date and then by owner name to make records with matching dates easier to scan.
Can I keep the header row at the top?
Yes. Exclude the header from the rows being sorted and place the header above the formula output, or arrange the formula range so the header is not treated as a data record. For manual sorts, identify the header row in the sort options when that option is available.
Why does my sorted formula show an error?
A common cause is that cells where the results need to appear are already occupied. Clear enough space for the returned rows and columns. Also check that the source range and sort-column number are correct, and that the range does not accidentally treat a header as a record.
Is a filter the same as automatic sorting?
No. A filter provides controls for sorting and hiding rows, but does not continuously reorder the source after every edit. Use a formula for a live sorted view or a script when the original rows themselves must be automatically rearranged.
Related
- Regression Analysis in Excel: Steps, Results, and Meaning
- Data Cleaning in Excel: Practical Techniques That Work
- Data Cleaning Steps in Excel: A Practical Guide
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Excel Find and Replace Entire Cell ContentsTo replace a cell only when its entire contents match, press Ctrl+H in Excel for Microsoft 365 on…
- How to Create a Reusable Meeting Template in OutlookTo create a reusable meeting template, open classic Outlook for Windows, start a new meeting, fill in the…
- How to Calculate Percentage in Excel With a ShortcutIn Excel for Microsoft 365 on Windows, select the cells and press Ctrl+Shift+% to display their values as…
- Google Sheets Conditional Formatting With IFYes. In Google Sheets, use Format > Conditional formatting, choose Custom formula is, and enter a formula that…
- Excel Insert Shortcut: Add Cells, Rows, and ColumnsIn Excel for Microsoft 365 on Windows, select the cells, row, or column where you want space, then…
- Google Sheets Filter Dropdown: How to Use ItIn Google Sheets, a filter dropdown is the small control in a column header that lets you sort…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.