Problem:
Consider the following dataset containing some dates. We will try to sort the dates.
After applying the sort command, we get the following results:
The dates aren’t accurately sorted from most recent to the oldest accurately.
From the Home tab, view the data type.
The selected data are in text format. As a result, sorting doesn’t work properly.
The following two methods solve this problem so you can sort by date.
Method 1 – Change the Cell Format to Sort Date
Step 1:
- Select all the cells.
- Press the right mouse button.
- Choose Format Cells from the options.
- You can also go to the Format Cells option by using the keyboard shortcut CTRL + 1
- Alternatively, find the Format Cells option in the Number group in the Home tab of the Excel ribbon.
Step 2:
- Choose a date format from the Format Cells dialog box.
- Press OK.
Step 3:
- Modify the dates from the data cells. Insert 0 with single-digit months.
- Select all the cells containing a date.
- Go to the Data tab.
- Choose Newest to Oldest from the Sort and Filter group.
Check the below image and you’ll see dates sorted from latest to oldest.
Read More: [Solved!] Excel Sort Not Working
Method 2 – Use the Text to Columns Feature to Sort Date in Excel
Step 1:
- Select all the cells.
- Go to the Data tab.
- From the Data Tools group, choose Text to Columns.
Step 2:
- A dialog box named Convert Text to Columns Wizard will appear. Choose Delimited.
- Press Next.
Step 3:
- Select Next in the new dialog box.
Step 4:
- In the last dialog box, choose Date as the Column data format.
- Select a date format, such as the MDY option.
- Click Finish.
Step 5:
- Select all the data cells to apply the sort operation.
- Go to the Data tab and choose the Newest to Oldest option.
The following images shows the date sorting has been executed correctly.
Read More: [Fixed!] Sort and Filter Not Working in Excel
Things to Remember
- Always follow your chosen date formatting when inputting a date.
- Do not mix up time with dates.
- Carefully check if there is an error in the month and day values.
Download Practice Workbook
Download this practice workbook to complete exercises while you are reading this article.
Related Articles
- Excel Not Sorting Numbers Correctly
- [Fixed]: Sort by Cell Color Not Working in Excel
- [Fixed!] Sort Largest to Smallest Not Working in Excel
<< Go Back to Excel Sort Not Working | Sort in Excel | Learn Excel
Get FREE Advanced Excel Exercises with Solutions!
This was perfect! don’t know why my source data wouldn’t convert to dates well but this fixed the problem. Nice job!
Thanks, TODD! Good to hear from you!
Thanks for this! All my relevant cells were registered as dates, but not the same date format (they were copied over from different files/users), and this fixed my issues.
You’re welcome, LAUREN! I hope, you’ll find more other solutions in our blog related to Excel problems in future!
Thank you very much for this outstanding explanation.
My table is now wonderfully ordered by dates. Finally!
I appreciate you sharing your expertise.
Hello AJ,
You are most welcome.
Regards
ExcelDemy