Filtering and sorting a column in Excel helps you quickly find, organize, and analyze data by hiding irrelevant rows or rearranging values in ascending/descending order. You need only an Excel file with tabular data (ideally with headers) and Excel installed—no extra tools or add-ins required.
What You'll Need
- Microsoft Excel (any modern version: Excel 2016, 2019, 2021, Microsoft 365, or Excel for the web)
- A spreadsheet with data organized in columns, where the first row contains column headers (e.g., "Name", "Date", "Sales")
Step-by-Step
- Open your Excel file and ensure your data is in a contiguous block (i.e., no blank rows or columns within the dataset). Place your cursor anywhere inside the data range—do not select the entire column unless it’s clean data.
- Enable filtering:
- On Windows/macOS: Go to the Data tab on the ribbon, then click Filter. Alternatively, press Ctrl + Shift + L (Windows) or Cmd + Shift + F (Mac).
- In Excel for the web: Select the Data tab, then click Filter (the funnel icon).
- Apply a filter to a specific column:
- Click the dropdown arrow in the column header you want to filter (e.g., "Product" or "Status").
- In the filter menu, uncheck items you want to hide. For text columns, you can also use Text Filters (e.g., "Begins with", "Contains") or Number Filters for numeric columns.
- To filter dates, use Date Filters (e.g., "Before", "Between") or select specific dates.
- Click OK to apply. Only rows matching your criteria will remain visible.
- Sort the filtered or full column:
- With the column header selected (or your cursor in any cell of that column), go to the Data tab.
- For ascending sort (A→Z, smallest→largest), click A to Z. For descending sort (Z→A, largest→smallest), click Z to A.
- Important: If you have filtered data, sorting only affects visible (unfiltered) rows. To sort all data, clear filters first.
- Sort by multiple columns (optional):
- With your cursor in the dataset, go to Data > Sort.
- In the Sort dialog box, under Sort by, pick the first column (e.g., "Region"). Choose Values and the sort order (A to Z or Z to A).
- Click Add Level to add a second column (e.g., "Sales") and define its sort order.
- Repeat for additional levels if needed. Click OK to apply.
Common Mistakes
- Accidentally selecting blank rows: If you include empty rows/columns in your data range, Excel may treat them as separate tables. Always ensure your dataset is contiguous before filtering.
- Forgetting to uncheck "My data has headers": In the Sort dialog, if your data lacks headers but you check "My data has headers", Excel will sort the header row with the rest, corrupting labels. If your first row is data, uncheck this box.
- Filtering only part of a table: If your data is formatted as an Excel Table (Ctrl+T), filtering automatically applies to all columns. If it’s a plain range, ensure you select the full data block before filtering—otherwise, hidden rows may persist after filtering.
- Sorting without preserving rows: If you sort a single column in isolation (e.g., selecting only column C), Excel warns you that adjacent columns won’t move. Always sort with the full row selected, or use the Data > Sort dialog to sort the entire range.
Tips
- Use color coding: After filtering, you can color-code filtered rows by selecting visible cells (Alt+; on Windows, Cmd+Shift+\ on Mac), then applying fill color. This makes filtered results stand out.
- Clear filters quickly: Click the dropdown arrow in any filtered column, then select Clear Filter From [Column]. To remove all filters at once, go to Data > Clear.
- Sort numbers as text safely: If numbers like "00123" sort as "123", format the column as Text before entering data. Otherwise, Excel drops leading zeros.
- Use AutoFilter keyboard shortcuts: Press Alt+A, then F to toggle filters; Alt+A, S to open the Sort dialog. These work in every Excel version.
- Save your filtered view: Excel doesn’t save filter settings, but you can duplicate your worksheet and apply filters there, or use Custom Views (View > Custom Views) to store filter/sort combinations.
Troubleshooting
If filtering or sorting doesn’t work as expected, follow these checks:
- No dropdown arrows appear: Ensure your data has headers. If not, add a header row or, in the Sort dialog, uncheck "My data has headers". Also verify you’re not in Protected Sheet mode—if so, unprotect the sheet (Review > Unprotect Sheet) with the password if needed.
- Filter hides all rows: Double-check your filter criteria. A text filter like "Contains X" won’t match "x" (case-insensitive) unless you use wildcards correctly. Try removing filters step-by-step to isolate the issue.
- Sorting changes unexpectedly: If sorting a column rearranges data unpredictably, confirm you’re sorting the entire range—not just one column. In the Sort dialog, ensure the Expand the selection option is selected (it usually is by default).
- Excel treats numbers as text: Filter/sort may group "10" before "2". Fix by converting columns: select the column > Data tab > Text to Columns > Finish (no changes needed). Or use Find & Replace to add a leading apostrophe, then remove it.
- Filtered rows reappear after sorting: This happens if you sort before saving the filtered view. Always apply filters first, then sort visible rows. To avoid this, clear all filters before sorting if you want a clean full-data sort.
Frequently Asked Questions
Can I filter and sort at the same time?
Yes—filter first to show only the rows you want, then sort the filtered results. Excel sorts only visible rows by default. If you sort before filtering, the filter will still apply afterward, hiding rows but preserving the sort order of the remaining ones.
Why does Excel ask if I want to expand the selection when sorting?
Excel is warning that you’ve selected only one column but your data spans multiple columns. If you click Sort with Expand, all rows move together (correct). If you choose Sort columns, only the selected column sorts, breaking data integrity. Always choose Sort with Expand unless you intentionally want to sort one column in isolation.
How do I sort dates correctly?
Ensure your date column is formatted as Date (right-click column > Format Cells > Date). If Excel stores dates as text (e.g., "Jan-05"), they’ll sort alphabetically. Convert them by selecting the column > Data > Text to Columns > Finish.
Can I filter for blank or non-blank cells?
Yes. In the column’s filter dropdown, scroll to the bottom and check (Blanks) to show only empty rows, or uncheck it to exclude blanks. For non-blank rows, simply leave (Blanks) unchecked.
Do filters work on protected sheets?
Only if the sheet was unprotected before filtering or if protection allowed sorting/filtering. To enable this, unprotect the sheet, apply filters, then reprotect it. When protecting, check Sort and Use AutoFilter under Allow all users of this worksheet to.
Is there a way to sort without disrupting formulas?
Yes—use structured references if your data is an Excel Table (Ctrl+T). Formulas referencing table columns (e.g., =[@Sales]) update automatically when rows sort. For regular ranges, ensure formulas use relative references (e.g., =B2*C2) rather than absolute (=$B$2*$C$2), so they move with their rows.