Updated June 9, 2023
Excel Sort by Date (Table of Contents)
Introduction to Sort by Date in Excel
To sort the data by Date in Excel, we must have the dates in one single format. Go to the Data menu tab, and under the Sort & Filter category, select the Sort option. Check the box of My Data has Headers by a tick. Then select the column which has the Date and choose the Order by which we want to Sort it. It can be the Oldest to the Newest or Vice-Versa. There is another way to apply the filter in the headers. Then, select Newest to Older or Vice-Versa from the drop-down of the Date column to sort the Date in Excel.
Where to find the Sort Option in Excel?
In Excel, the sort option is available under the Data tab.
If you want to sort dates in Excel, we can use either from oldest to newest or newest to oldest.
- Oldest to Newest: This will bring the old dates first and push the latest dates to the bottom.
- Newest to Oldest: This will bring the latest dates to the top and push the old dates to the bottom of the data.
We can select any of the above options based on the user’s requirements.
How to Sort by Dates in Excel?
It is very simple and easy. Let us understand the working of Excel sort by Date with some examples.
Look at the below data. I have sales numbers from the year 2012 to 2017. Sales are made across dates in these years.
Now I want to sort the Excel data from old dates to new dates. Follow the below steps to unleash this option.
- Select the entire data set. If you are sorting dates, it does not mean you need to select only the date column, but you need to select the entire data set. If you select only the dates column, data will be interchanged. In this example, I am selecting the data from A1 to B23.
- Go to Data < Sort. The shortcut key to open the sort option is ALT + D + S in Excel.
- The sort option is available under the Data tab.
- Once you click on the Sort option, it will open the below dialogue box.
- Before selecting the Sort by option, make sure the My data has headers checkbox is ticked. This will make the first row of the data selection as headers.
- Now click on the drop-down list of Sort by. Here you will see two headers of the selection; select the Date option.
- Under the order section, select how you want to sort the data. In this example, I am selecting Oldest to Newest.
- Once all the options are selected, click on the OK button.
- It will sort all the data based on the dates from Oldest to Newest.
Each color represents each year’s dates. It has sorted the data from 30th June 2010 to the latest Date of 27th Oct 2017.
Take the same data from the above example for this example as well. The above example has sorted the data from the DD-MM-YYYY format.
But here, we will do different sorting. I want to sort the data based on the Date and month. For example, June month together irrespective of the year.
- Insert one helper column called Date & Month.
- Apply the TEXT formula as shown in the below image.
TEXT formula ignores the year part and returns only the Date and month name.
1. DD – This will represent the day from the Date.
2. MM – This will return the month in numbers. For example, for June, it will return 06.
3. MMM – This will return month in Text with 3 characters. For September, it will return Sep.
- Select the entire data, including the newly inserted column, and press the shortcut key to open the sort option. (I am leaving the shortcut key to you because I have already mentioned the shortcut key in the previous example).
- From the drop-down, select the newly inserted column Date & Month.
- Now, look at the Order section. It is not showing the date formatting of Oldest to Newest or Newest to Oldest. It is offered as A to Z. The newly inserted row is not in the date format but in text format. Select A to Z.
- If you click OK, it will sort instantly and open up one more dialogue box. Select the below option from that dialogue box and then click OK.
- It will sort the data based on the criteria we have given.
Look at the above image; it has been sorted based on the Date and the month, irrespective of the year. It has put all Jan together, all Feb together, and so on.
Things to Remember about Sort by Date in Excel
- It is essential to select My data has headers.
- You can create your custom list as well.
- The custom list includes your Order.
- We sort Text, numbers, and dates.
- To sort dates, the dates column should be formatted as a date.
This is a guide to Excel Sort by Date. Here we discuss how to sort by dates in Excel, practical examples, and a downloadable Excel template. You can also go through our other suggested articles to learn more –