Sort by Date in ExcelTutorial with Screenshots

Written By:
Patrick Louie
Reviewed By:
FundsNet Staff

Working with a well-organized and neat-looking dataset is easier than working with one that is all over the place.

For example, let’s say you’re working with sales invoices.

Wouldn’t it be easier to find the data that you need if they were sorted in chronological order?

Looking for a sales invoice with an SI no. of 0001?

If the dataset is sorted properly, you’d easily find this particular sales invoice at the very top (probably the first row after the column headers).

If you’re looking for sales invoices that were released in a particular month, you can easily find them if the dataset is ordered chronologically.

Another benefit of sorting by date (or chronological order) is that you can have an insight into how the data has progressed over time.

And if you’re working in Excel, then sorting your dataset by date is made easier. It is one of Excel’s most handy features after all.

Excel gives you plenty of control over how to sort your dataset by date.

Do you want to sort the date by day?

Excel allows that.

How about by week?

You can too!

Even sort the date by month, or year.

You can also choose whether to arrange dates in ascending or descending order.

This is particularly helpful if you want to work with the most recent data entry first.

In this article, we will be learning how to sort a dataset by date in excel, whether it be by single or multiple columns.

We will also discuss how you can troubleshoot an issue where Excel is not properly sorting by date.

By the end of the article, you should be to reliably sort by date in Excel.

Use the Sort Function to Sort by Date in Excel

Excel’s Sort function is a nifty tool that allows you to sort your dataset according to your preference.

You can use it to arrange numbers from smallest to largest and vice versa.

You can also use it to arrange texts in alphabetical order.

But most importantly (for the topic of this article), you can use the Sort function to arrange dates in chronological order.

To access the Sort function, you’ll have to open the Data tab. In this tab, you’ll see the Sort & Filter section.

You’ll find the Sort button there which will open the Sort dialog box.

Beside it are two buttons that also sort data. One arranges the data in ascending order while the other does so in descending order.

Sort Dates Using the Sort Function (Single Column)

For illustration purposes, we will be using the following dataset (the dates are in MM/DD/YYYY format):

What we want to do here is sort the data by date.

  • Select the column that contains the data that you want to sort. In our illustration, this will be column A. You can do this by clicking the column header as shown below.

  • Open the Data tab. In this tab, you will find the Sort & Filter section. You have three options here to sort data. If you simply want to arrange the dates in ascending order, you only need to click the button with an A on top of a Z. On the other hand, if you want to arrange the dates in descending order, click the button with a Z on top of an A.

  • If you want more sorting options, click the Sort button. This will open the Sort dialog box.

  • Depending on whether there is data in the adjacent column of your selection, you might see the following warning message. Since we’re only working with a single column, tick the button before the “Continue with the current selection”. Then click the Sort button.

  • If your selection has headers, be sure to check the box before “My data has headers”. For the dropdown list below Sort on, be sure to select Cell Values. In the dropdown list after Order, you can choose to arrange the dates in ascending or descending order. Click the OK button after doing so. (In our illustration, we will be sorting the dates in ascending order)

  • The dates should now be sorted accordingly.

Sort Dates Using the Sort Function (Multiple Columns)

Suppose you have a dataset that you want to sort by date.

Most probably, you don’t want to be sorting only the column that contains the dates.

You want to sort the entire data set by date, which is a process that involves sorting data in multiple columns.

We’ll be using the following data set for illustration:

Our goal this time is to sort the entire dataset by date.

  • Select the cells that you want to sort. In our illustration, this would be cells A1 to D9.
  • Open the Data tab. In this tab, click the Sort button located in the Sort & Filter section. This will open the Sort dialog box.

  • In the sort dialog box, you will see three dropdown lists. But first, if your selection has column headers, be sure to check the box before “My data has headers”.

  • In the dropdown list next to Sort by, be sure to select the column that contains the dates. In our illustration, the column that contains the date has the header “Date”.

  • In the dropdown list below “Sort on”, select “Cell Values”.

  • In the dropdown list below “Order”, select whether you want to arrange the dates in ascending or descending order. (In our illustration, we will be sorting the dates in ascending order)

  • Click the OK button. This should sort the selection by date.

  • Your selection will be sorted by date.

Troubleshoot: Excel is Not Sorting Data by Date

If you followed the instructions above but your data is not sorted by date properly, it could be that the dates were formatted as texts.

If that is the case, the data will not be properly sorted by date because Excel does not recognize the dates as dates.

Solution#1: Check Whether the Cells Containing the Dates are in the Date Format

The first solution is to check if the cells containing the dates are in the date format. If not, set these cells in the date format.

  • Select the column that contains the dates that you want to sort.
  • To check if the cells are in the date format, open the Home tab. Then in the Numbers section, you will see the cell format. It should show “Date”.

  • If not, set the cell format to Date. Click the dropdown button to select the cell format. From the selection, select the appropriate Date format.

  • If you want more format options, you can right-click on the selected column. Then select the Format Cells option.

  • This will open the Format Cells dialog box. Open the Number Tab and select Date.

  • In the Type list, select your preferred date format. Then click the OK button.
  • This should properly format the values so that they’ll be recognized as dates. You can now try sorting the dataset by date.

Solution#2: Use the ISTEXT Function to Check if Cells Are in The Date Format

Another way to check if the cells containing dates are in the date format is to use the ISTEXT function.

Simple select a blank cell (preferably adjacent to the cell that contains the date value) and type the formula:

=ISTEXT(cell that contains the date).

For example, if we want to know check whether cell A2 is in the date format, the formula will be =ISTEXT(A2).

The ISTEXT function will return two values: TRUE or FALSE. If it’s TRUE, then Excel sees the data as text rather than date.

If it’s FALSE, then Excel should see the data as a date. Format the cells that return an ISTEXT value of true into the date format.

Then delete the column that contains the ISTEXT values. You can now sort your dataset by date.

Solution#3: Use the Text to Columns Feature to Convert Cells Into the Date Format

If the above solutions still don’t work, then you might have to convert the cells into the date format using the Text to Columns feature.

  • Select the column that contains the dates that you want to sort.
  • Open the Data tab. Click the Text to Columns button. This will open the Convert Text to Column wizard.

  • In the first step of the wizard, make sure to select the Delimited option. Click the Next button.

  • In the second step, uncheck all the options under the Delimiters category. Then click the Next button.

  • In the third step, select Date as the Column data format. Next to it, you can select the date format (e.g. DMY, MDY, YMD). Then click the Finish button.

  • This should convert the column to the Date format. You can now sort the dataset by date.

Conclusion

And that’s how you sort by date in Excel, whether it be on a single column or multiple columns.

I’ve also shown you ways to troubleshoot in case Excel doesn’t properly sort by date.

I hope that you’re able to use your learning here in your future endeavors.