Sort and filter data
last updated at: 2 Nov 2026
Sorting rearranges your rows by the values in a chosen column. Filtering hides rows that don't match the values you pick, so you can focus on the data you care about. Both work on the same sheet at the same time.
Sort a range
Quick sort
- Highlight the range you want to sort.
- Open the Data menu and hover over Sort range.
- Choose Ascending to sort A to Z (or smallest to largest), or Descending to sort Z to A (or largest to smallest).
Sort range works on one selected range, so it stays grayed out until exactly one range is selected. Sheets sorts by the first column of your selection. It sorts the rows from the first to the last one with a value in that column, the first row included, so empty rows above or below them stay where they are. To keep a header row in place, use Custom sort. You can also right-click a cell in the range and choose Sort range A → Z or Sort range Z → A.
Custom sort
Custom sort lets you choose which column to sort by, and whether your data has a header row.
- Highlight the range you want to sort.
- Open the Data menu, hover over Sort range, and click Custom sort.
- Tick Data has a header row if the first row contains column names. Sheets leaves that row in place and uses the column names in the Sort by dropdown.
- Choose the column to sort by from the Sort by dropdown.
- Select Ascending or Descending.
- Click Sort.
As with a quick sort, the rows that move are those from the first to the last one with a value in the first column of your selection.
Sorting does not work on a range that contains merged cells. Unmerge the cells first, then sort.
Filter rows by value
A filter adds a dropdown arrow to each column header in your data. Click an arrow to choose which values that column should show, and rows that don't match are hidden.
Turn on a filter
- Click any cell in your data.
- Open the Data menu and click Create filter.
A dropdown arrow appears in each header cell of the data range. The range is highlighted with a blue border.
You can also right-click a cell and choose Create a filter.
Choose which rows to show
- Click the dropdown arrow in the column you want to filter.
- A panel opens with the values found in that column. All values are checked (visible) by default.
- Use the buttons at the top of the panel to change the whole selection at once:
- Check all: shows every row.
- Clear: hides every row.
- Inverse: reverses your current selection.
- To narrow the list, type in the search box below those buttons.
- Untick individual values you want to hide.
- Click Confirm to apply the filter.
Rows hidden by the filter are still in your sheet. They come back the moment you change or remove the filter. Rows you hid yourself stay hidden, except those the filter hid as well.
Filter by cell color or font color
If your cells have different background or font colors, you can filter by color instead of value.
- Click the dropdown arrow on the column.
- Hover over Filter by color.
- A sub-panel shows the colors used in that column. Untick any color to hide rows with that color.
- Click Confirm.
Sort from the filter dropdown
The filter dropdown also lets you sort the whole filtered range by that column without leaving the panel. Click Ascending sort or Descending sort at the top of the dropdown.
Remove the filter
To remove all filters at once, open the Data menu and click Clear filter. The dropdown arrows disappear and the rows the filter hid return.
To remove just one column's filter, click that column's dropdown arrow, click Check all so all values are ticked, and click Confirm. The rows return, but the filter stays active on the other columns.