The sample dataset showcases Number of Visits of websites, their Name and Category. Dates and Platforms are also given.
Solution 1 – There are Blank Cells and the Excel Sort Function does Not Work
F7 and F10 are blank in the dataset.
To apply the Sort tool:
- Select the whole dataset.
- In the Home tab, select Sort & Filter.
- Choose Custom Sort.
- Choose Number of Visits in Sort by and Smallest to Largest in Order.
- Click OK.
An error is displayed and the blank cells are located at the bottom of the table.
To solve the issue:
- Either delete the blank rows or fill the blank cells with cell values and apply the Sort tool again.
Read More: [Solved!] Excel Sort Not Working
Solution 2 – A Leading Space is Present When the Excel Sort Function is Applied
There’s a leading space in C8, C11, and C15.
- Apply the Custom Sort for Category of the Sites and choose A to Z.
Categories including the leading space are placed before all other categories.
- Go to C8 and remove the space before the text.
You’ll get the expected output if you apply the Custom Sort again.
Solution 3 – There is Mixed Data Type in the Same Column
In F5:F15, F6, F8, F9, F11, and F13 hold numbers stored as text with leading zeros.
Sorting will not work.
- Select Sort and the dialog box Sort Warning will be displayed.
- Check Sort anything that looks like a number, as a number.
This is the output.
Read More: Excel Not Sorting Numbers Correctly
Solution 4 – The Excel Sort by Date Function does Not Work When there Is Text Format
The Sort feature is not working in the date column.
If you apply Sort to Date of Visiting, you’ll get the following output.
The date is in Text format.
- Open Format Cells by pressing CTRL + 1.
- Choose a Date format.
This is the output.
You may also apply the Text to Column feature.
Solution 5 – Excel Filter Is Not Working When there are Blank or Hidden Rows
Rows 8 and 12 are blank.
- Select the cell range you want to filter.
- Go to the Home tab and select Editing.
- Choose Filter in Sort & Filter.
The output includes blank rows.
- Uncheck Blank Cells.
This is the output.
Solution 6 – There are Merged Cells and the Excel Filter does not work
There are merged cells in the dataset.
You’ll get errors if you filter. You need to unmerge cells.
- Go to the Home tab.
- Select Unmerge Cells in Merge & Center.
Read More: Excel Sort by Cell Color Not Working
Solution 7 – The Excel Filter Stops Working If Errors are Present
In the dataset below, there are errors in F5:F15.
To filter data:
- Uncheck Number and Text.
Solution 8 – The Excel Filter Doesn’t Work with the Column Heading
There must be a single row in the column header.
Insert a new line:
- Press ALT + ENTER to insert a line break.
- Use the Wrap Text option.
Sort and Filter are Grayed out in Excel
Activate the tool by ungrouping the sheets.
- Right-click and choose Ungroup Sheets.
Download Practice Workbook
Related Articles:
<< Go Back to Excel Sort Not Working | Sort in Excel | Learn Excel
Get FREE Advanced Excel Exercises with Solutions!