Use Excel with your keyboard and a screen reader to sort and filter tables. Sorting data helps you organize and find the data that you want quickly, for faster analysis. Filtering data helps you focus on a particular set of data, which is especially useful in large worksheets.
Need instructions on how to sort or filter data in Excel, but not using a screen reader? See Sort data in a range or table or Filter data in a range or table.
In this topic
Keyboard shortcuts for sorting and filtering
This table shows keyboard shortcuts for sorting and filtering.
| To do this |
Press |
| Turn the AutoFilter dropdown menu in a column heading off and on |
Ctrl+Shift+L |
| Sort smallest to largest, or A to Z |
Alt+A, S, A or Alt+Down arrow key, S |
| Sort largest to smallest, or Z to A |
Alt+A, S, D or Alt+Down arrow key, O |
| Open the Sort dialog box |
Alt+A, S, S or Alt+H, S, U |
| Reapply a sort after you change the data |
Ctrl+Alt+L or Alt+A, Y, 3 |
| Filter by color |
Alt+Down arrow key, I |
| Filter by number or text |
Alt+Down arrow key, F |
| Open the Format Cells dialog box |
Alt+H, O, I |
| Use the TRIM function |
Alt+M, T, and then move to TRIM with the Down arrow key |
Learn about sorting in Excel
You can sort data by text (A to Z or Z to A), numbers (smallest to largest or largest to smallest), and dates and times (oldest to newest or newest to oldest) in one or more columns. You can also sort by a custom list (such as Large, Medium, and Small) or by format, including cell color, font color, or icon set. Most sort operations are column sorts, but you can also sort by rows.
When you sort a table, Excel saves the criteria that you used with the workbook so that you can reapply it each time that you open the workbook. This feature is especially important for multicolumn sorts or for sorts that take a long time to create. However, this feature only works for data in a table, it doesn't apply to just a range of cells. If you want to save sort criteria so that you can periodically reapply a sort when you open a workbook, use a table.
Note
Once you sort the data, you can't restore the original order. If you didn't save the file after sorting, you can use undo (Ctrl+Z) to go back. If you're going to be doing sorts and always want to restore original order, add a column and fill it with a series (1,2,3, and so on) as an index before you start. When you want to restore the original order, sort the index column.
Sort text in a table or range
Sort text in a table
- Use the arrow keys to go to the header row in the table. When you're on the header row, you hear "Header item" after the cell location.
- Press the Right or Left arrow key to move to the column header for the data that you want to sort.
- Press Alt+Down arrow key to open the filter menu, and then press Tab until you hear "Menu, Sort A to Z, unchecked menu item."
- The options that appear depend on the kind of data in the column. For example, you can sort numeric data from smallest to largest or largest to smallest. You can sort alphanumeric data from A to Z or from Z to A. You can also sort by color.
- Use the Down arrow key to browse the options, and then press Enter to select an option. You hear "Sorted," followed by the selected option.
Sort text in a range
Use the arrow keys to go to a column of alphanumeric data in a range of cells, or to a table column containing alphanumeric data.
Press Alt+A. The Data tab opens, and you hear "Ribbon tabs, Selected, Data tab item."
Do one of the following actions:
- To sort in ascending alphanumeric order (Sort A to Z), press S and then A.
- To sort in descending alphanumeric order (Sort Z to A), press S and then D.
Make a case sensitive sort
- Use the arrow keys to navigate to a column of alphanumeric data in a range of cells, or to a table column containing alphanumeric data.
- Press Alt+H, S, U. The Sort dialog box opens, and you hear "Sort window, OK button."
- Press Alt+O to open the Sort Options dialog box, and you hear "Sort options. Unchecked, Case sensitive checkbox."
- Press Spacebar to select the Case sensitive checkbox.
- Press Enter. The Sort Options dialog box closes, and you hear "Sort, Options button."
- To close the Sort dialog box and apply your changes, press Tab until you hear "OK button," and then press Enter.
- Sort text as explained in Sort text in a range.
Tip
If the column you sort contains a mixture of numbers and text, you might have to format them all as text. Otherwise, Excel sorts the numbers as numbers first, and then sorts the text. To format the data, press Ctrl+Spacebar to select all the data in the column, and then press Alt+H, F, N. Press the Left arrow key until you hear "Selected, Number tab item," press Tab once, and then press the Down arrow key until you hear "Text." Press Tab once to move to the OK button, and press Enter.
Sort numbers
- Use the arrow keys to go to a column of numeric data in a range of cells, or to a table column containing numeric data.
- Press Alt+A. The Data tab opens, and you hear "Ribbon tabs, Selected, Data tab item."
- Do one of the following:
- To sort from smallest to largest, press S and then A.
- To sort from largest to smallest, press S and then D.
Check that numbers are stored as numbers
- Use the arrow keys to go to a column of numeric data in a range of cells, or to a table column containing numeric data. Then, press Ctrl+Spacebar to select all the data in the column.
- Press Alt+H, F, N. The Format Cells dialog box opens, and you hear "Format cells."
- To move to the Number tab, use the Left arrow key (or press Ctrl+Tab). You hear "Number tab item."
- Press Tab. The Category list opens, and you hear the currently selected category, such as "General" or "Date."
- Press the Up or Down arrow key until you hear "Number."
- Press Tab until you hear "Decimal places," followed by the number of decimal places currently used. If you want to change this value, type the new number of decimal places. To remove decimals completely, type 0.
- To close the Format Cells dialog box and apply your changes, press Tab until you hear "OK button," and press Enter.
Sort dates and times
- Use the arrow keys to go to a column of dates or times in a range of cells, or to a table column containing dates or times.
- Press Alt+A. The Data tab opens, and you hear "Ribbon tabs, Selected, Data tab."
- Do one of the following:
- To sort from oldest to newest, press S and then A.
- To sort from newest to oldest, press S and then D.
- To reapply a sort after you change the data, select a cell in the range or table and then press Ctrl+Alt+L.
Sort by more than one column
You might want to sort by more than one column or row when you have data that you want to group by the same value in one column or row, and then sort another column or row within that group of equal values. For example, if you have a Department column and an Employee column, you can first sort by Department (to group all the employees in the same department together), and then sort by name (to put the names in alphabetical order within each department). You can sort by up to 64 columns.
Note
For best results, the range of cells that you sort should have column headings. To sort by rows, make sure the My table has headings checkbox is cleared in the Sort dialog box. Press Alt+H, S, U to open the Sort dialog box, and press Tab until you hear "Checked, My data has headers checkbox" or "Unchecked, My data has headers checkbox." If you need to clear the checkbox, press Spacebar, press Tab until you hear "OK, button," and press Enter to apply the change.
Use the arrow keys to navigate to a range of cells with two or more columns of data, or to a table with two or more columns.
Press Alt+A, S, S. The Sort dialog box opens, and you hear "Sort, OK button."
Press Tab until you find the Column: Sort by combo box. You hear "Sort by," followed by the column name, and then "editable combo box." Use the Up and Down arrow keys to select the first column that you want to sort.
Press Tab until you find the Sort On combo box. You hear "Sort on, Cell Values, editable combo box." If you don't hear "Cell Values," press the Up and Down arrow keys until you do.
To select how you want to sort the cell values, press Tab until you find the Order combo box. You hear "Order," followed by the currently selected option, and then "editable combo box." Use the Up and Down arrow keys to select A to Z, Z to A, Smallest to Largest, or Largest to Smallest.
To add another column to sort by, use Tab to move to the Add Level button, press Enter, and then repeat steps three through five.
Note
The Sort By combo box is called Then By for the additional columns.
To reapply a column sort after you change the data, select a cell in the range or table and then press Ctrl+Alt+L.
Note
Ctrl+Alt+L doesn't reapply a row sort.
Tips for problems with sorting
If you get unexpected results when sorting your data:
- Check if the values returned by a formula changed. If the data that you sorted contains one or more formulas, the return values of those formulas might change when the worksheet recalculates. In this case, make sure that you reapply the sort to get up-to-date results.
- Unhide rows and columns before you sort. Hidden columns aren't moved when you sort columns, and hidden rows aren't moved when you sort rows. Before you sort data, unhide the hidden columns and rows.
- Check the locale setting. Sort orders vary by locale setting. Make sure that you have the proper locale setting in Regional Settings or Regional and Language options in Control Panel on your computer.
- Turn on or off the heading row. It's usually best to have a heading row when you sort a column to make it easier to understand the meaning of the data. By default, the value in the heading isn't included in the sort operation. Occasionally, you might need to turn the heading on or off so that the value in the heading is or isn't included in the sort operation.
- To exclude the first row of data from the sort because it's a column heading, press Alt+H, S, U. In the Custom Sort dialog box, select the My data has headers checkbox.
- To include the first row of data in the sort because it isn't a column heading, press Alt+H, S, U. In the Custom Sort dialog box, clear the My data has headers checkbox.
Filter data in a table
When you put your data in a table, Excel automatically adds an AutoFilter dropdown menu to each column header. You can open this menu to filter quickly. To remove the AutoFilter dropdown menu from a column heading, select the header and then press Ctrl+Shift+L.
- In the table header of the column you want to filter, press Alt+Down arrow key. The AutoFilter dropdown menu opens, and you hear "Menu."
- On the AutoFilter menu, if the column has numbers, use the Down arrow key to move to Number Filters and press Enter. If the column has text entries, use the Down arrow key to move to Text Filters and press Enter. The submenu opens, and you hear "Equals."
- To move to the filtering option you want, use the arrow keys and press Enter. The Custom AutoFilter dialog box opens, and you hear "Custom AutoFilter."
- Type or select your filtering conditions.
For example, to show numbers above a certain amount, select Greater Than Or Equal To, and then enter the number you have in mind in the next combo box.
To filter by two conditions, enter filtering conditions in both sets of edit combo boxes. For both the conditions to be true, press Shift+A to select the And condition. For either of the conditions to be true, press Shift+O to select the Or condition.
- To close the dialog box, press Tab until you hear "OK button," and then press Enter.
Filter data in a range
- Select the cells you want to filter. Go to the cell you want as the top left cell of the selection. Hold Shift and use the Right and Down arrow keys to expand the selected range of cells.
- Press Ctrl+Shift+L. Excel adds an AutoFilter dropdown menu to the first cell of each column in the range.
- In the table header of the column you want to filter, press Alt+Down arrow key. The AutoFilter dropdown menu opens, and you hear "Menu."
- Use the arrow keys and Tab to move to the filtering options you want. Use Spacebar to clear or select a filter value checkbox.
- When you make your selections, press Enter to apply the filter.
To clear the filter and remove the AutoFilter dropdown menus, select any cell in the range and press Ctrl+Shift+L.
See also
Use a screen reader to title a table in Excel
Use a screen reader to add comments to an Excel worksheet
Use a screen reader to create column headers in a table in Excel
Keyboard shortcuts in Excel
Basic tasks using a screen reader with Excel
Set up your device to work with accessibility in Microsoft 365
Use a screen reader to explore and navigate Excel
What's new in Microsoft 365
Use Excel for Android with TalkBack, the built-in Android screen reader, to sort and filter tables. Sorting helps you organize and analyze data. Filtering data is especially helpful when your worksheets contain large amounts of data.
Note
- This topic assumes that you are using the built-in Android screen reader, TalkBack. To learn more about using TalkBack, go to Android accessibility.
In this topic
Sort data in Excel
You can sort textual and numeric data in an Excel worksheet to arrange it in a specific order, such as texts from A to Z or Z to A, numbers from smallest to largest or largest to smallest, and dates and times from earlier to later or later to earlier.
Note
Once you sort the data, you cannot restore the original order.
Tap somewhere in the Excel sheet. TalkBack announces the selected cell.
Flick left or right until you're in the column you want to sort. Double-tap the screen to activate the selection.
Drag one finger near the top of the screen until you hear "More options, button," and then double-tap the screen. You hear "Tab menu," followed by the currently selected tab, for example, "Home, selected."
If you're not on the Home tab, double-tap the screen. The tab menu opens. Flick right or left until you hear "Home, tab," and then double-tap the screen.
On the lower part of the screen, flick up with two fingers repeatedly, until you reach the end of the list. TalkBack plays sounds when you flick, and stays silent when you reach the end of the list.
Explore the list by dragging one finger on the lower part of the screen until you hear "Sort and Filter menu," and then double-tap the screen.
Do one of the following actions:
- To sort alphanumeric data from A to Z, or from smallest to largest, or to sort dates and times from earlier to later, flick right until you hear "Sort Ascending, switch," and then double-tap the screen.
- To sort alphanumeric data from Z to A, or from largest to smallest, or to sort dates and times from later to earlier, flick right until you hear "Sort Descending, switch," and then double-tap the screen.
To return to the worksheet, flick right until you hear "On, more options switch," and then double-tap the screen.
Sort a range of cells
If your workbook contains empty cells, select a range first, and then sort the range.
Drag one finger near the top of the screen until you hear "More options, button," and then double-tap the screen. You hear "Tab menu," followed by the currently selected tab, such as "Home, selected."
If you're not on the Home tab, double-tap the screen. The tab menu opens. Flick right or left until you hear "Home, tab," and then double-tap the screen.
On the lower part of the screen, flick up with two fingers repeatedly, until you reach the end of the list. TalkBack plays sounds when you flick, and stays silent when you reach the end of the list.
Explore the list by dragging one finger on the lower part of the screen until you hear "Select Range," and then double-tap the screen.
The Select Cell or Range dialog box opens, and the focus is in the range field. Use the on-screen keyboard to type the range you want to select, such as A1:C15. Drag your finger around the lower-right corner of the screen until you hear "Done," and double-tap the screen. The range is now selected.
Drag one finger near the top of the screen until you hear "More options, button," and then double-tap the screen.
On the lower part of the screen, flick up with two fingers repeatedly, until you reach the end of the list. TalkBack plays sounds when you flick, and stays silent when you reach the end of the list.
Explore the list by dragging one finger on the lower part of the screen until you hear "Sort and Filter menu," and then double-tap the screen.
Do one of the following actions:
- To sort alphanumeric data from A to Z, or from smallest to largest, or to sort dates and times from earlier to later, flick right until you hear "Sort Ascending, switch," and then double-tap the screen.
- To sort alphanumeric data from Z to A, or from largest to smallest, or to sort dates and times from later to earlier, flick right until you hear "Sort Descending, switch," and then double-tap the screen.
Sometimes you need to reformat the data to get the right results when sorting.
- Go to the cell or column you want to format. Double-tap the screen to activate the selection.
- Drag one finger near the top of the screen until you hear "More options, button," and then double-tap the screen. You hear "Tab menu," followed by the currently selected tab, for example, "Home, selected."
- If you're not on the Home tab, double-tap the screen. The tab menu opens. Flick right or left until you hear "Home, tab," and then double-tap the screen.
- On the lower part of the screen, flick up with two fingers repeatedly, until you reach the end of the list. TalkBack plays sounds when you flick, and stays silent when you reach the end of the list.
- Flick left until you hear "Number Format menu," and then double-tap the screen.
- Flick right until you hear the format you need, and then double-tap the screen.
You can choose from the following formats: General, Number, Currency, Accounting, Date, Time, Percentage, Fraction, Scientific, Text, and Special.
Tips for resolving issues with sorting
If you get unexpected results when sorting your data, check the following items:
If the data you sorted contains one or more formulas, the return values of those formulas might change when the worksheet recalculates. In this case, make sure that you sort again to get up-to-date results.
Hidden columns aren't moved when you sort columns, and hidden rows aren't moved when you sort rows. Before you sort data, unhide the hidden columns and rows. To unhide, in the Excel workbook:
- Go to a row or column next to a hidden column or row. TalkBack announces: "Adjacent to hidden cells."
- Drag your finger to the column header, or left to the row number, and then double-tap the screen to select the entire column or row. The context menu opens.
- Flick right until you hear "Unhide, button," and double-tap the screen.
Check the locale setting on your phone. Sorting results can vary depending on the locale setting.
Filter data in a table
In Excel, slide one finger on the screen until you hear "Entering table," followed by the table and cell details.
Flick left or right to go to the column you want to filter, and double-tap the screen.
Tip
If you hear "Cut button," flick Down-then-left to close the context menu.
Drag your finger around the bottom of the screen on the taskbar until you hear "Filter options button," and double-tap the screen.
The Sort and Filter menu opens. Flick right until you hear "Filter items button," and double-tap the screen. The focus is in the Search field. Double-tap the screen to activate the Search field and to bring up the keyboard.
Type the criteria you want to filter with.
When done, drag your finger around the upper part of the screen until you hear "Select All Results, button," and do one of the following:
- To select all search results, double-tap the screen.
- To browse the search results, flick right until you hear the result you want, and then double-tap the screen. You can select multiple search results.
Drag one finger at the upper-right corner of the screen until you hear "Done button," and double-tap the screen.
The Sort and Filter menu closes and you return to the table with the selected filter criteria applied.
See also
Use a screen reader to insert a table in an Excel worksheet
Keyboard shortcuts in Excel
Basic tasks using a screen reader with Excel
Set up your device to work with accessibility in Microsoft 365
Use a screen reader to explore and navigate Excel
What's new in Microsoft 365
Use Excel for the web with your keyboard and a screen reader to place, sort, and filter data in a table. Filtering data helps you focus on a particular set of data, which is especially useful in large worksheets.
Need instructions on how to filter data in Excel, but not using a screen reader? See Filter data in a range or table.
Note
- To learn more about screen readers, go to How screen readers work with Microsoft 365.
- When you use Excel for the web, use Microsoft Edge as your web browser. Because Excel for the web runs in your web browser, the keyboard shortcuts are different from those in the desktop program. For example, use Ctrl+F6 instead of F6 for jumping in and out of the commands. Also, common shortcuts like F1 (Help) and Ctrl+O (Open) apply to the web browser – not Excel for the web.
In this topic
Place data in a table
Select the data you want to filter.
Press Ctrl+L to open the Create Table dialog box. You hear "Create table."
If your table contains no headers, press Enter after opening the Create Table dialog box.
Tip
If your table contains no headers, Excel for the web creates them by inserting placeholder texts in the first row. Default placeholder texts are Column 1, Column 2, Column 3, and so on. You can change the name of the header text by clicking on it and entering the name you want.
If your table contains headers, press Tab until you hear "Unchecked my table has headers checkbox." Press Spacebar to select the checkbox, and then press Enter.
Sort text in a table
- Navigate to the header row in the table using the arrow keys. When you are on the header row, you hear "Header item" after the cell location.
- Press the Right or Left arrow key to move to the column header for the data that you want to sort.
- Press Alt+Down arrow key to open the filter menu, and then press Tab repeatedly until you hear: "Menu, Sort A to Z, unchecked menu item."
- The options that appear depend on the kind of data in the column. For example, you can sort numeric data from smallest to largest or largest to smallest. You can sort alphanumeric data from A to Z or from Z to A. You can also sort by color. Use the Down arrow key to browse the options, and press Enter to select an option. You hear "Sorted," followed by the selected option.
Sort text in a range
- Use the arrow keys to navigate to a column of alphanumeric data in a range of cells, or to a table column containing alphanumeric data.
- Press Alt+Windows logo key, A. The Data tab opens, and you hear "Ribbon tabs, Selected, Data tab item."
- Do one of the following:
- To sort in ascending alphanumeric order (Sort A to Z), press S and then A.
- To sort in descending alphanumeric order (Sort Z to A), press S and then D.
Filter data in a table
- Select the header cell of the column you want to filter.
- Press Alt+Down arrow key to open the Filter and Sort dropdown menu.
- Press the Down arrow key until you hear "Text Filters" or "Number Filters," and then press Enter to access the submenu. You hear "Text Filters" if the column contains only text or a combination of text and numbers. You hear "Number Filters" if the column contains only numbers.
- Press the Down arrow key in the submenu until you hear the name of the filter you want to apply to your data, and then press Enter. A Custom Filter dialog box opens for each filter option. When the dialog box opens, you hear "Dialog custom filter focus on editing," and when the action is complete, you hear "Filter applied."
Press Tab to move between fields in the Custom Filter dialog box, including the And/Or radio buttons.
- Clear an applied filter by first selecting the header cell of the column you want to reset. If you select cell A1, for example, press Alt+Down arrow key to expand the dropdown menu, and then press the Down arrow key until you hear "Clear filter from Column 1." press Enter to make a selection. When the action is completed, you hear "No filter applied." If you renamed the header text for cell A1, you hear the name of the header instead of "Column 1."
Filter data in a range
- Select the cells you want to filter. Navigate to the cell which you want to be the top left cell of the selection, and then hold Down Shift and use the Right and Down arrow keys to expand the selected range of cells.
- Press Ctrl+Shift+L. Excel adds an AutoFilter dropdown menu to the first cell of each column in the range.
- Select the cell with the AutoFilter dropdown menu. Press Alt+Down arrow key. The AutoFilter dropdown menu opens, and you hear "Menu."
- Use the arrow keys and Tab to move to the filtering options you want. Use Spacebar to clear or select a filter value checkbox.
- When you've made your selections, press Enter to apply the filter.
- To clear the filter and remove the AutoFilter dropdown menus, select any cell in the range and press Ctrl+Shift+L.
Filter options for tables
Number Filters options
- Equals - Filters column to display the exact number you type in the Custom Filter dialog box.
- Does Not Equal - Filters column to display all numbers except the exact number you type in the Custom Filter dialog box.
- Greater Than - Filters column to display all numbers with a greater value than the number you type in the Custom Filter dialog box.
- Less Than - Filters column to display all numbers with a lesser value than the number you type in the Custom Filter dialog box.
- Between - Filters column to display all numbers within a specific numerical range. Input the range in the two provided Custom Filter dialog boxes.
- Top 10 - Filters column to display numbers with the highest or lowest numerical values or percentages. You hear the name of the active cell and "Focus on editing 10" when the dialog box opens. The dialog box defaults to the top 10 numbers (called items), but you can change this number to any value. To filter percentages instead of numbers, press Tab until you hear "Items," and then press Alt+Down arrow key. Press the Down arrow key until you hear "Percentage," and then press Enter. To filter bottom numbers or percentages, press Tab until you hear: "Top editable combo box." Press Alt+Down arrow key. Then, press the Down arrow key to select "Bottom," then press Enter.
- Above Average - Filters column to display the numbers that are above the average value of all numbers in the column.
- Below Average - Filters column to display the numbers that are below the average value of all numbers in the column.
- Custom Filter - Use this option to choose the filter you want to apply to your numerical data from a dropdown menu. To use this option, first type the number you want to filter into the dialog box. Next, press Tab until you hear "Editable combo box." Press Alt+Down arrow key to view the dropdown menu. Use the Down arrow key to select your desired filter, and then press Enter. When the action is completed, you hear "Filter applied."
Text Filters options
- Equals - Filters the column to display the exact text you type in the Custom Filter dialog box.
- Does Not Equal - Filters the column to display everything except the text you type in the Custom Filter dialog box.
- Begins With - Filters the column to display data that begins with the exact text you type in the Custom Filter dialog box. The text can have any ending.
- Ends With - Filters the column to display data that ends with the exact text you type in the Custom Filter dialog box. The text can have any beginning.
- Contains - Filters the column to display data that includes the exact text you type in the Custom Filter dialog box.
- Does Not Contain - Filters the column to display data that doesn't include the text you type in the Custom Filter dialog box.
- Custom Filter - Allows you to choose the filter you want to apply to your data from a dropdown menu. To use this option, first type the text you want to filter. Next, press Tab until you hear "Editable combo box." Press Alt+Down arrow key to view the dropdown menu. Use the Down arrow key to select your desired filter, and then press Enter. When the action is completed, you hear "Filter applied."
See also
Use a screen reader to insert a table in an Excel worksheet
Use a screen reader to create a chart and select a chart in Excel
Use a screen reader to add comments to an Excel worksheet
Use a screen reader to find and replace data in Excel
Keyboard shortcuts in Excel
Basic tasks using a screen reader with Excel
Use a screen reader to explore and navigate Excel