Smart Systems for Home

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

How to Put a Sort Button in Excel: Step-by-Step

· 5 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

Excel doesn't have a dedicated "sort button" you can drag onto the sheet, but you can add one to the Quick Access Toolbar or ribbon in about a minute. The quickest method is to click the small arrow at the end of the Quick Access Toolbar, choose More Commands, add Sort (or Sort Ascending/Sort Descending) from the list, and click OK. That button then sits at the top of the window and works on whatever cell or range you have selected. The steps below cover that method plus how to add a sort control to the ribbon or a custom tab, and how to use it correctly so you don't scramble your data.

What You'll Need

  • Excel for Windows or Excel for Mac (the desktop app). The Quick Access Toolbar customisation described here is not available in Excel for the web.
  • A workbook with data organised in columns, ideally with a header row.
  • No add-ins required — the Sort command is built in.

Step-by-Step

  1. Open your workbook and click any cell inside the data you want to sort. If you want to sort only part of the data, select that range first. If you want to sort the whole table, selecting one cell is enough because Excel will detect the surrounding block.
  2. Add the button to the Quick Access Toolbar. Look at the very top-left of the Excel window, above the ribbon. At the right end of the small toolbar of icons, click the down arrow (Customize Quick Access Toolbar).
  3. Choose More Commands from the menu that opens. A dialog box appears with a list of commands on the left and the current toolbar contents on the right.
  4. Set the dropdown to All Commands. Near the top of the dialog, the "Choose commands from" dropdown may default to Popular Commands. Change it to All Commands so you can find Sort.
  5. Find and add Sort. Scroll the left list until you see Sort (or Sort Ascending / Sort Descending if you prefer separate buttons). Select it and click Add. It moves to the right-hand list.
  6. Position the button (optional). Use the up and down arrows on the right side of the dialog to move Sort where you want it on the toolbar.
  7. Click OK. The Sort icon now appears on the Quick Access Toolbar. It stays there for all workbooks unless you remove it.
  8. Use the button. Select a cell in the column you want to sort by, then click your new Sort button. The Sort dialog opens so you can choose the column, sort order, and whether the range has headers. If you added Sort Ascending or Sort Descending instead, clicking it sorts immediately by the active column.
  9. Confirm the header option. In the Sort dialog, tick My data has headers if your first row contains column names. This keeps the header row at the top instead of sorting it into the data.

Menu labels can differ slightly by Excel version, device, and region. On Excel for Mac, the Quick Access Toolbar is also at the top of the window, but the customisation dialog is reached through the same down-arrow menu; the command names are the same.

Common Mistakes

  • Sorting a single column instead of the whole table. If you select only one column and click Sort, Excel may ask whether to expand the selection. Choosing "Continue with the current selection" sorts that column alone and breaks the row relationships. Always expand the selection or select one cell inside the table.
  • Forgetting the header row. If "My data has headers" is unticked, Excel treats your column titles as data and sorts them into the rows.
  • Sorting merged cells. Merged cells prevent sorting. Unmerge them first.
  • Expecting the button in Excel for the web. The web version has Sort commands on the Data tab, but it does not offer the same Quick Access Toolbar customisation.
  • Sorting a filtered list and assuming hidden rows move. Hidden rows stay put unless you clear the filter first.

Tips

  • Add both Sort Ascending and Sort Descending to the toolbar for one-click sorting without opening a dialog.
  • You can also add Sort to a custom ribbon tab: right-click the ribbon, choose Customize the Ribbon, create a new group, and add the command there.
  • Use Data > Sort when you need multi-level sorting (for example, by department, then by last name). The toolbar button opens the same dialog.
  • Before sorting a large dataset, make a copy of the sheet or press Ctrl+Z immediately if the result is wrong.
  • If you sort often, consider converting the range to an official Excel Table (Ctrl+T). Tables carry filter and sort arrows in the header row automatically.

Troubleshooting

  • The Sort button is greyed out. Check that you have selected a cell inside a data range, not an empty cell or a chart. Also confirm the sheet is not protected; protected sheets block sorting until you unprotect them.
  • The button disappeared. Someone may have reset the Quick Access Toolbar. Re-add it using the steps above. If you are on a shared or roaming profile, the toolbar may not carry over to another computer.
  • Data got mixed up after sorting. Press Ctrl+Z to undo. Then select the entire table (including headers) before sorting, or use the Sort dialog with "My data has headers" ticked.
  • Sort options are missing on Mac. Make sure you are in the desktop app, not Excel for the web. The Data tab on Mac includes Sort, and the Quick Access Toolbar customisation is available from the toolbar menu.
  • Sorting does not change the order. The column may contain formulas that return the same value, or the data may be formatted as text with leading spaces. Check for stray spaces and consistent data types.

Frequently Asked Questions

Can I add a sort button to the worksheet itself?

Not as a native floating button. You can insert a Form Control button and assign a macro that runs a sort, but that requires VBA. For most users, the Quick Access Toolbar or ribbon is the practical option.

Does the Sort button work in Excel for the web?

The web version has sort options on the Data tab, but it does not support customising the Quick Access Toolbar the way the desktop app does.

Will the button sort by the column I click or by the whole row?

It sorts by the active column and rearranges entire rows, provided the whole table is selected or Excel detects the surrounding data.

How do I remove the button later?

Click the Quick Access Toolbar down arrow, choose More Commands, select Sort in the right-hand list, and click Remove.

Can I sort by more than one column with the button?

Yes. The Sort button opens the Sort dialog, where you can add levels (Sort by, Then by) for multi-column sorting.