Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

How to Sort and Filter All Columns in Excel

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To sort and filter all columns in Excel, first format your data as a table or ensure headers are in a single row. Then select any cell in the data, go to the Data tab, and click Filter or Sort. Excel automatically applies the action to all columns in the contiguous range. For full control, use Sort & Filter options and check the 'My data has headers' box.

What You'll Need

  • Microsoft Excel (any recent version for Windows, Mac, or web).
  • Data arranged in a contiguous range or an Excel Table with a single header row.
  • No completely blank rows or columns within the data you want to sort or filter.

Step-by-Step

  1. Prepare your data. Ensure each column has a unique header in the first row. Remove any blank rows or columns inside the data range. If your data is not already a table, consider converting it: select the range, press Ctrl+T (Cmd+T on Mac), confirm the range and that 'My table has headers' is checked, and click OK. Tables automatically expand when you add data and keep filters and sorts applied to all columns.
  2. Select the data range. Click any cell inside your data. Excel will detect the surrounding range. If you want to be explicit, select the entire range including headers.
  3. Apply filters to all columns. Go to the Data tab and click Filter. Drop-down arrows appear in each header cell. Alternatively, press Ctrl+Shift+L (Cmd+Shift+L on Mac) to toggle filters. If you converted to a table, filter buttons are added automatically.
  4. Use the filter drop-downs. Click the arrow in any column header to open the filter menu. You can sort A to Z or Z to A, filter by specific values, apply text, number, or date filters, or use search. The filter applies only to that column, but because filters are enabled on all columns, you can combine criteria across multiple columns.
  5. Sort all columns at once. To sort the entire dataset by one column, click the filter arrow in that column and choose Sort A to Z or Sort Z to A. Excel sorts all rows based on that column, keeping related data together. For more advanced sorting, go to Data > Sort. In the Sort dialog, ensure 'My data has headers' is checked. Choose the column to sort by, the sort on (values, cell color, font color, or conditional formatting icon), and the order (A to Z, Z to A, or custom list). Click Add Level to sort by multiple columns. Click OK to apply.
  6. Clear filters when done. To remove all filters but keep the filter buttons, go to Data > Clear. To remove filter buttons entirely, click Filter again or press Ctrl+Shift+L.

Note: Menu labels and exact locations can differ slightly by Excel version, platform, and region. The steps above apply to Excel for Microsoft 365 and Excel 2019/2021 on Windows and Mac. Excel for the web has similar options under the Data tab.

Common Mistakes

  • Sorting a single column without expanding the selection. If you select only one column and click Sort, Excel may ask to expand the selection. Always choose 'Expand the selection' to keep rows intact. Otherwise, data becomes misaligned.
  • Leaving blank rows or columns in the data. Excel treats blank rows as breaks in the data range, so filters and sorts may not include all rows. Remove blanks or convert to a table.
  • Forgetting to check 'My data has headers'. In the Sort dialog, if this is unchecked, Excel may sort the header row into the data. Always verify this option.
  • Applying filters to only part of the data. If you select a subset before clicking Filter, only that subset gets filter buttons. Select the entire range or a single cell inside the data first.
  • Using merged cells. Merged cells can prevent sorting and filtering from working correctly. Unmerge cells before sorting or filtering.

Tips

  • Convert your range to an Excel Table (Ctrl+T) for automatic expansion and persistent filters.
  • Use the filter search box to quickly find specific values, especially in long lists.
  • For multi-level sorting, use Data > Sort and add levels. This lets you sort by multiple columns in one go.
  • To filter by color, click the filter arrow and choose Filter by Color. This works if you have applied cell or font colors.
  • Use keyboard shortcuts: Ctrl+Shift+L to toggle filters, Alt+Down Arrow to open a filter menu, and Ctrl+Shift+Arrow keys to select data ranges quickly.
  • When sorting dates or numbers, ensure they are stored as actual dates or numbers, not text. Text-formatted numbers sort alphabetically, not numerically.

Troubleshooting

  • Filter arrows do not appear. Check that you have selected a single cell within a contiguous data range. If the data is in a table, filters should already be there. If not, go to Table Design and check Filter Button. Also ensure the worksheet is not protected; go to Review > Unprotect Sheet if needed.
  • Sorting mixes up rows. This usually happens when only one column is selected. Undo (Ctrl+Z), then select the entire data range or a single cell, and sort again. Always expand the selection when prompted.
  • Filter does not include all rows. There may be blank rows or columns within the data. Remove them or convert the range to a table. Also check that the filter range covers all rows; you can reapply the filter by clicking Filter twice.
  • Sort dialog does not show headers. Ensure 'My data has headers' is checked in the Sort dialog. If headers are not in the first row of the selection, Excel may not detect them.
  • Cannot sort or filter because of merged cells. Unmerge all cells in the range (Home > Merge & Center > Unmerge Cells) and try again.
  • Data changes when filtering. Filters hide rows, they do not delete them. If rows seem to disappear, clear the filter to show all data. To remove filters entirely, click Filter on the Data tab.

Frequently Asked Questions

How do I sort all columns by one column in Excel?

Click any cell in the column you want to sort by, then go to Data > Sort A to Z or Z to A. Excel automatically expands the selection to include all adjacent columns, keeping rows together. Alternatively, use the filter drop-down on that column and choose a sort option.

Can I filter multiple columns at once?

Yes. When filters are enabled on all columns, you can set criteria in multiple columns. For example, filter column A for "North" and column B for ">100". Excel shows only rows that meet all criteria. Use the filter drop-downs in each column to set conditions.

Why does Excel sort only one column instead of the whole table?

This happens when you select only one column before sorting. Excel may prompt you to expand the selection; choose 'Expand the selection'. To avoid this, select a single cell inside the data and use the Sort or Filter buttons on the Data tab, which automatically detect the entire range.

How do I remove filters but keep the filter buttons?

Go to Data > Clear to remove all filter criteria while keeping the filter buttons visible. To remove the filter buttons entirely, click the Filter button on the Data tab or press Ctrl+Shift+L.

Can I sort by multiple columns at once?

Yes. Go to Data > Sort, ensure 'My data has headers' is checked, then add levels for each column you want to sort by. Set the order for each level and click OK. Excel sorts by the first level, then the second, and so on.

What should I do if sorting or filtering is greyed out?

The worksheet may be protected. Go to Review > Unprotect Sheet and enter the password if prompted. Also, if the data is in a pivot table, sorting and filtering work differently; use the pivot table's own sort and filter options.