SheetsXSheetsX
Google Sheets sort & filter assistant

Google Spreadsheet: How to Sort and Filter

Sort a Google Sheet by text, number, or date without breaking rows. Then filter the same table to show only the records you need—or ask SheetsX to do both in one prompt.

Reviewed by the SheetsX team

Sheet1 · A1:D9
Account
Region
Status
Leads
BrightPath Studio
North
Active
92
Northwind Labs
West
Active
53
Harbor & Finch
East
Active
46
Summit Forge
North
Active
42
Atlas & Co
South
Active
31
Leads: highest → lowest
Status: Active only
Quick answer

How to sort in Google Sheets and keep each row together

Select the complete table, choose Data → Sort range → Advanced range sorting options, turn on Data has header row, then choose the sort column and A → Z or Z → A. To filter the sorted table, choose Data → Create a filter and set a value or condition from the target column header. Sorting reorders rows; filtering only hides nonmatching rows.

Recorded demo

Watch SheetsX sort and filter a Google Sheet

The Agent sorts a fictitious account table by Leads from highest to lowest, filters Status to Active, keeps the header, and confirms that no rows or values were deleted.

Fictitious demo data · no email shown
Prompt used in the demo

“On Sheet1, sort the table A1:D9 by Leads in column D from highest to lowest. Then apply a filter to Status in column C so only Active rows are visible. Keep the header in row 1, keep all values unchanged, do not delete rows, and do not create a new sheet.”

Manual method

Sort a Google spreadsheet by one column

Sorting a range is safer than sorting one column by itself because the values in every row stay aligned.

Google's official sort and filter instructions
  1. 1

    Select the entire table

    Include every column whose values must move together, including the header row.

  2. 2

    Open advanced range sorting

    Choose Data → Sort range → Advanced range sorting options.

  3. 3

    Protect the header

    Turn on Data has header row so column names remain at the top.

  4. 4

    Choose column and direction

    Pick the target column. Use A → Z for ascending or Z → A for descending.

Filter in a Google spreadsheet

Show matching rows without deleting the rest

Select the table, choose Data → Create a filter, then use the filter icon in a header. Filter by selected values, text, number, date, or color. The row count at the bottom of the sheet helps verify how many records remain visible.

Use a filter view when collaboration matters

A basic filter can change the view for collaborators. A named filter view lets different people sort and filter the same source at the same time. Use Data → Create filter view, give the view a clear name, and share its URL when needed.

Removing a filter restores hidden rows; it does not undo the sort order.
Choose the right method

Sort range, sort sheet, SORT formula, or SheetsX?

MethodWhat changesBest use
Sort rangeReorders only the selected rangeTables beside notes or calculations that must stay in place.
Sort sheetReorders every row in the sheet by one columnSheets where the entire grid belongs to one dataset.
SORT functionReturns a live sorted copy without moving the sourceDashboards and derived views that should update automatically.
SheetsX AgentApplies the requested sort and filter to the named rangeMulti-step cleanup described in plain English.

Live sorted copy

=SORT(A2:D9,4,FALSE)

Live filtered copy

=FILTER(A2:D9,C2:C9="Active")
SheetsX workflow

Describe the final table, not every menu click

Tell the Agent the sheet, exact range, sort key, direction, filter condition, and safeguards. It can complete both actions and report what is visible afterward.

Install SheetsX
  • Open a new Agent chat for a clean task context.
  • Name the sheet and full table range.
  • Specify the sort column and ascending or descending order.
  • Define the exact filter value or condition.
  • Protect the header and explicitly forbid row deletion or value changes.
FAQ

Google Sheets sort and filter questions

How do I sort in Google Sheets without mixing up rows?+

Select the complete table, not a single column, then use Data → Sort range → Advanced range sorting options. Turn on Data has header row and choose the column and direction. Google Sheets moves each row together.

How do I sort a Google spreadsheet from highest to lowest?+

Select the table, open Data → Sort range → Advanced range sorting options, mark the header row, choose the numeric column, and select Z → A. For a formula-based result, use SORT with the third argument set to FALSE.

How do I filter in a Google spreadsheet?+

Select the table and choose Data → Create a filter. Open the filter icon in the target header and choose values or a condition. The unmatched rows are hidden, not deleted.

What is the difference between a filter and a filter view?+

A basic filter can affect what collaborators see. A filter view saves a named view and lets people use different filters at the same time without changing one another's view.

Can I sort and filter Google Sheets with one SheetsX prompt?+

Yes. Name the sheet and range, specify the sort column and direction, define the filter condition, and state that the header and values must remain unchanged. The recorded demo on this page uses that pattern.

Does filtering delete rows in Google Sheets?+

No. A filter hides rows that do not match its current rules. Remove the filter or select all values in the filter menu to show those rows again.