Clear, practical technology insights BSOD Code Lookup · Windows Error Code Lookup · Wi-Fi Troubleshooting · PC Troubleshooting Checklist

How to Sort and Filter Data in Google Sheets

Sort complete records safely, exclude headers, filter by one or more columns, and use filter views without changing a collaborator’s view.

Table of Contents

In Google Sheets, sorting changes row order and filtering hides rows that do not match your criteria. Before sorting, include every column belonging to the same records so names, addresses, dates, and quantities stay together. Use a filter view when you want a personal view of shared data.

Check that each column has a clear heading and contains consistent values. Numbers stored as text and ambiguous dates may sort unexpectedly; see number formats in Google Sheets before relying on the order.

Choose sheet sorting or range sorting

When sorting data, the first important step is to decide whether you want the sorting to apply to the entire worksheet or to a selected area.

Sorting by worksheet reorders rows across the active sheet using a selected column as the sort key. It does not sort every tab in the spreadsheet file. Related information on each row is stored together when sorting is applied. In the image below, the Name column has been sorted to display customer names alphabetically. The address information of each customer has been stored with their corresponding name.

Sort and filter data Picture 1

Sorting by range arranges data within a range of cells, which can be useful when working with a spreadsheet containing multiple tables. Only cells within that selection move. Include all related columns in the range; selecting only a name column can detach names from the addresses beside them.

Sort and filter data Picture 2

Sort the active sheet

The example sorts a customer list by last name. For a sheet containing one continuous table, keep the header separate from the data. If the sheet contains several independent tables, use range sorting instead.

1. If row 1 contains the headings, choose View > Freeze > 1 row. For headers elsewhere or a table within a larger sheet, use the range-sorting method below.

Sort and filter data Picture 3

2. The header row is frozen. Decide which column to sort, then click a cell in the column.

Sort and filter data Picture 4

3. Choose Data > Sort sheet, then sort by the active column A to Z or Z to A. A to Z means ascending alphabetical, numeric, or date order for correctly recognized values.

Sort and filter data Picture 5

4. Verify that complete records stayed together and that the header was not moved. If the result is wrong, use Undo immediately.

Sort and filter data Picture 6

How to sort a range

For example, we would select a sub-table in the t-shirt order form to sort the number of t-shirts ordered by class.

1. Select the range of cells you want to sort. For example, we would select the range G3:H6.

Sort and filter data Picture 7

2. Choose Data > Sort range > Advanced range sorting options. Older screenshots show Sort range opening the dialog directly.

Sort and filter data Picture 8

3. If the selected range includes a header, check Data has header row. Choose the sort column. Use Add another sort column if ties should be ordered by a second field.

Sort and filter data Picture 9

4. Choose ascending or descending order. For example, we will choose descending order (ZA). Then click Sort.

Sort and filter data Picture 10

5. The range will be sorted according to your selection (in the example, the data has been sorted in descending order by the Orders column ).

Sort and filter data Picture 11

How to create a filter

The example filters an equipment log to show laptops and projectors. Include a header row in the filter range. Freezing it helps you read the table while scrolling, but is not required to create a filter.

1. Optionally freeze the header with View > Freeze. See freezing rows and columns for keeping headings visible.

Sort and filter data Picture 12

2. Select the complete table range, including the header row. This makes the intended filter area explicit.

Sort and filter data Picture 13

3. Click the toolbar’s Create a filter button, or choose Data > Create a filter.

Sort and filter data Picture 14

4. A drop-down arrow will appear in each column header.

Sort and filter data Picture 15

5. Click the drop-down arrow for the column you want to filter. For example, this will filter column B to view only certain types of devices.

Sort and filter data Picture 16

6. Under Filter by values, click Clear to deselect the available values. This clears the selection in the menu, not the data in the sheet.

Sort and filter data Picture 17

7. Select the data you want to filter, then click OK. For example, you would select Laptop and Projector to view only these types of devices.

Sort and filter data Picture 18

8. The data will be filtered, temporarily hiding any content that doesn't meet the criteria. In this example, only laptops and projectors are displayed.

Sort and filter data Picture 19

Apply multiple filters

Filters on different columns combine: a row must satisfy each active column filter to remain visible. For example, you might have filtered your spreadsheet to show laptops and projectors, and now want to narrow it down further to show only laptops and projectors that were checked in August.

1. Click the drop-down arrow for the column you want to filter. For example, this will add a filter to column D to view information by date.

Sort and filter data Picture 20

2. Select or deselect the boxes depending on the data you want to filter, then click OK. The example uses an August label. For actual date values, use a date condition covering the intended month and year rather than assuming the text label matches every date in August.

Sort and filter data Picture 21

3. A new filter will be applied. In the example, the spreadsheet is now filtered to show only the laptops and projectors that were checked in August.

Sort and filter data Picture 22

If you're collaborating with others on a spreadsheet, you can create filter views. Creating filter views allows you to filter data without affecting other people's data views; it only affects your own view. It also allows you to name the views and save multiple views. Use Data > Create filter view or the available filter-view controls. Naming and saving a view requires suitable access; a temporary viewer’s view may not be retained.

Sort and filter data Picture 23

How to remove all filters

Choose Data > Remove filter or turn off the filter with the toolbar control. Rows hidden by the filter reappear, but removing it does not restore an earlier sort order. For a filter view, close that view to return to the normal view.

Sort and filter data Picture 24

Discussion

Reader Comments 0

Sign in with email or Google to join the discussion.