A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data
The activation method depends on the workbook state; first check whether the worksheet is protected, because Excel disables sorting when the sort range contains locked cells.
1. Check worksheet protection
Open Review and inspect the protection command:
- If it says Unprotect Sheet, select it and enter the password if prompted.
- Select a cell in the data, then choose Data → Sort & Filter → Sort.
If the sheet must remain protected:
- Unprotect it temporarily.
- Select the entire range that users need to sort, including headers and any hidden rows.
- Press Ctrl+1 → Protection.
- Clear Locked, then select OK.
- Select Review → Protect Sheet.
- Enable Sort, set a password if required, and select OK.
Merely enabling Sort during protection is insufficient: Excel cannot sort a protected range containing locked cells.^1^
2. Check whether worksheets are grouped
Look for [Group] in Excel’s title bar or multiple highlighted worksheet tabs. If present:
- Right-click any selected worksheet tab.
- Select Ungroup Sheets.
- Select one cell in the data and retry Data → Sort.
Excel displays Group in the title bar when multiple worksheets are selected; right-clicking a selected tab provides the Ungroup Sheets command.^2^
3. Confirm the workbook is editable
If a yellow Protected View banner appears, and the file is from a trusted source, select Enable Editing. Protected View is read-only and disables most editing commands.^3^
If Excel shows Viewing or the file is locked:
- Select Viewing → Request more access → Ask to edit, or ask the owner to grant edit permission.
- If the file is locked by your own account, close it on other devices and wait briefly for the lock to clear.^4^
4. Check for merged cells
If Sort becomes selectable but fails or reports that merged cells must be identically sized:
- Make a backup first because unmerging can alter the layout.
- Select the complete sorting range.
- Open Home → Alignment dialog launcher → Alignment.
- Clear Merge cells and select OK.
- Retry the sort.
Excel cannot sort a range containing inconsistently sized merged cells.^5^
5. Isolate a workbook-specific problem
Create a blank workbook, enter a few values, select one value, and try Data → Sort A to Z. The normal Windows procedure is to select a cell in the target column and use the Data → Sort & Filter commands.^6^
- Sort works in the blank workbook: the original file has a protection, permission, grouping, or range-layout restriction.
- Sort remains gray in every workbook: close Excel and reopen it in Safe Mode. If sorting works there, investigate add-ins or the current Windows profile; a matching Excel case was resolved by testing with a new Windows user profile.^7^
References
- [Windows](https://support.microsoft.com/excel/protect-a-worksheet#enable-worksheet-protection)
- [Newer versions](https://support.microsoft.com/excel/select-worksheets)
- What is Protected View? | Microsoft Support
- Excel file is locked for editing | Microsoft Support
- You might receive an error message when you sort a range that contains merged cells in Excel
- [Windows](https://support.microsoft.com/excel/sort-data-in-a-range-or-table-in-excel#learn-more-about-general-issues-with-sorting)
- None of the sorting buttons work - Microsoft Q&A