sodcalculator

10 Tech How-To

Sort & Filter a Google Sheets Table: Step-by-Step

Guide 10-9702 · Updated · Step by step

Sorting and filtering a Google Sheets table lets you rearrange rows by a column’s values (A→Z, smallest→largest) and temporarily hide rows that don’t meet criteria, without deleting data. This is essential for quickly finding top sales, cleaning up a list, or preparing data for a chart. You’ll need a Google account and a spreadsheet with a header row (column titles) and at least one column of data.

What You’ll Need

  • A Google account (free).
  • A Google Sheets spreadsheet with data in a table format (headers in row 1, no blank rows/columns within the data).
  • Basic familiarity with selecting cells and using menus.

Step-by-Step

  1. Open your spreadsheet in Google Sheets (sheets.google.com).
  2. Select the entire data range (including headers). Click the first cell (e.g., A1), then press Ctrl+Shift+End (Windows) or Cmd+Shift+End (Mac). Alternatively, click and drag over all rows/columns.
  3. Create a filter view (recommended for safety): Go to Data → Filter views → Create new filter view. This saves your filter/sort settings as a named view, leaving the original data untouched. (If you prefer a simple filter, just click the funnel icon in the toolbar.)
  4. Click the green funnel icon that appears in the top-left corner of the selected range (or the funnel icon in the toolbar). This adds a drop-down arrow to each header cell.
  5. Sort by a column: Click the drop-down arrow in the header of the column you want to sort (e.g., “Price�). Choose Sort A→Z (for text: alphabetical; for numbers: smallest to largest) or Sort Z→A (reverse). All rows will reorder together, keeping each row’s data intact.
  6. Filter by values: Click the same drop-down arrow. Uncheck the boxes next to values you want to hide (e.g., uncheck “Red� to hide all red items). Click OK. Only rows with checked values remain visible.
  7. Filter by condition: In the drop-down, choose Filter by condition → select a condition (e.g., “Greater than� for numbers, “Text contains� for text). Enter the value (e.g., “100�) and click OK. Rows that don’t meet the condition are hidden.
  8. Combine sort and filter: You can apply a filter to one column and a sort to another simultaneously. The filter hides rows first, then the sort orders the visible rows.
  9. Clear a filter: Click the drop-down arrow in the filtered column → Clear filter. To remove all filters, click the funnel icon again (or Data → Turn off filter).
  10. Save your filter view: If using a filter view, click the green “Save� button in the top-right of the view bar. Name it (e.g., “Top 10 by Sales�) and click Save. To exit the view, click the X in the view bar.

Common Mistakes

  • Sorting only one column: If you select only a single column before sorting, the rows will not stay together—data in other columns will be misaligned. Always select the entire data range.
  • Including blank rows/columns: Blank rows within the range can cause sorting/filtering to treat them as separate blocks. Ensure your data is contiguous.
  • Forgetting to freeze header row: If you don’t freeze the header row, scrolling down hides the column titles, making it hard to know which column you’re viewing. Go to View → Freeze → 1 row.
  • Filtering without selecting the whole table: If you click a single cell and then apply a filter, Google Sheets may only apply it to that column. Always select the full range first.
  • Overwriting data with a sort: Sorting rearranges the actual data. If you need the original order later, use a filter view or copy the sheet first.

Tips

  • Use filter views for different analyses without altering the original data. You can create multiple views (e.g., “By Dateâ€�, “By Categoryâ€�) and switch between them.
  • Sort by multiple columns: To sort by one column then another (e.g., by Category, then by Price), use Data → Sort range → Advanced range sorting options. Add multiple sort columns and set the order.
  • Use keyboard shortcuts: After selecting the range, press Ctrl+Shift+L (Windows) or Cmd+Shift+L (Mac) to toggle filters on/off quickly.
  • Filter by color: If you have cell or text colors, the filter drop-down includes “Filter by colorâ€� to show only rows with a specific color.
  • Copy filtered data: When you copy visible rows and paste elsewhere, only visible (filtered) rows are copied. This is handy for extracting a subset.
  • Use the “SORTâ€� function for a formula-based sort that updates automatically. For example, =SORT(A2:C50, 2, TRUE) sorts by column B ascending.

Troubleshooting

  • Sorting messes up row data: This happens when you select only part of the range. Undo (Ctrl+Z) and re-select the entire table before sorting.
  • Filter arrows not appearing: Make sure you’ve selected the data range and clicked the funnel icon. If you’re in a filter view, the arrows appear automatically.
  • Filter hides everything: You likely unchecked all values or set a condition that no row meets. Clear the filter and re-check your criteria.
  • Sort order seems wrong: Check if your column has mixed data types (e.g., numbers stored as text). Convert text to numbers by selecting the column → Format → Number → Number.
  • Filter view not saving: You must click the green “Saveâ€� button in the view bar, not just close the view. If you exit without saving, changes are lost.
  • Filtered rows still appear in formulas: Most formulas (like SUM) ignore hidden rows, but some may not. Use SUBTOTAL (e.g., =SUBTOTAL(9, A2:A50)) to sum only visible rows.

Frequently Asked Questions

Q: How do I sort by date in Google Sheets?
A: Click the drop-down in the date column and choose Sort A→Z (oldest to newest) or Z→A (newest to oldest). Ensure dates are formatted as dates (Format → Number → Date).

Q: Can I filter by text that contains a specific word?
A: Yes. Click the drop-down → Filter by condition → Text contains → type the word → OK.

Q: How do I remove duplicate rows after filtering?
A: Filtering doesn’t remove duplicates. Use Data → Data cleanup → Remove duplicates after selecting your range. This deletes duplicate rows permanently.

Q: Why does my filter disappear when I close the sheet?
A: If you used a simple filter (not a filter view), it is not saved. Use Data → Filter views → Create new filter view to save it.

Q: Can I share a sheet with a filter applied?
A: Yes, if you use a filter view, you can share the sheet and the view will be available to viewers. Simple filters are not visible to others.

Q: How do I sort by a column but keep the header row in place?
A: Always select the data range including headers, then sort. The header row is recognized because it’s the first row, and it stays at the top. If it doesn’t, freeze the header row first.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →