# How to Sort by Date and Time in Excel (4 Useful Methods)

Get FREE Advanced Excel Exercises with Solutions!

Sorting implies rearranging data to get a better visual presentation of your dataset. It is such a powerful tool that can organize text, numbers, and dates. In this tutorial, Iâ€™ll show the ways to sort by date and time in Excel smartly including real-life examples.

Letâ€™s have a look at our following dataset. Here, the Order ID of products is given along with their Delivery Date, Delivery Time, and also Price.

Now weâ€™ll sort the above dataset based on Delivery Date and Time.
Letâ€™s get started.

## 1. Using Direct Excel Drop-down Option to Sort Date & Time

Using the direct drop-down option, you can simply sort the dataset by date and time separately. Actually, this method doesnâ€™t provide sorted data by date and time combinedly. But we have to know, whatâ€™s the problem with it!
For this just follow the following steps.

• Firstly, select the whole dataset.
• Secondly, click Home tab > Sort & Filter toolbar > Filter
• Alternatively, you can press the effective shortcut CTRL+SHIFT+L.

• Eventually, youâ€™ll get the drop-down arrow for each heading of the dataset like this.

• Thirdly, as you want to sort the dates, click on the drop-down arrow of the Delivery Date
• Fourthly, choose the Sort Oldest to Newest if you need to sort the dataset chronologically.
• Finally, press OK.

Consequently, the Delivery Date will be sorted chronologically like this.

• Similarly, click on the heading of the Delivery Time And, choose Sort Smallest to Largest if you wish to arrange time from start to endpoint.

• After that, youâ€™ll get the following sorted dataset.

The above screenshot clearly reveals that the Order ID is sorted based on Time and the Date is ignored here. How can we solve the problem? Weâ€™ll introduce you to a simple but powerful sorting option.

Read More: How to Undo Sort in Excel

## 2. Applying Custom Sort Option to Sort Date & Time in Excel

Custom sort is a special feature in Excel where you can specify different headings as levels and it provides the result combined based on the inserted levels.
Letâ€™s see the application of the essential option in the case of our dataset.

• Firstly, select the dataset.
• Secondly, click on the Home tab>Sort & Filter toolbar>Custom Sort.

• Eventually, a Sort dialog box will appear.
• Thirdly, select the Delivery Date from the heading in the Sort by
• Fourthly, choose the Oldest to Newest in the Order.

• As we want to sort time also, we have to append the desired heading. For this, click on the +Add Level Later, specify the Delivery Time as the heading, and Smallest to Largest as Order.
• Fifthly, click OK.

Consequently, the output will be like this in a chronological manner.

Read More: Excel Auto Sort when Data is Entered

## 3. Converting Date-Time to Number and Sorting in Excel

Assuming that, the Delivery Date and Time are provided together simultaneously. Interestingly, you can do that.

• Just insert the following formula in the E5 cell and press Enter.
`=C5+D5`

Here, C5 is the Delivery Date and D5 is the Delivery Time.

• Secondly, press ENTER.
• Thirdly, use the Fill Handle by dragging down the cursor while holding the right-bottom corner of the E5

• Eventually, weâ€™ll get the outputs like this.

You may be surprised how it is possible to add dates and times concurrently.
But it is really a simple thing, Excel counts the date as the serial number and time as a fraction of the serial number.
As we want to sort the Delivery Date-Time data, we have to convert the data into serial numbers.

• For this, fourthly, insert the following formula in the F5 cell like this.
`=VALUE(E5)`

• Fifthly, press ENTER and use the Fill Handle.

Now, we need to sort Delivery Date-Time in a chronological manner.

• To do this, firstly, select the dataset.
• Secondly, go to Home > click Editing > choose Sort & Filter > select Custom Sort.

If we donâ€™t select the whole dataset, this warning will appear. Then select Expand the selection and click Sort.

• Eventually, the Sort window will appear.
• Sixthly, choose Sorted Delivery Date-Time in the Sort by box and Smallest to Largest in the Order
• Seventhly, click OK.

Eventually, weâ€™ll get the outputs in Column F in a different format.
To fix the format, firstly, right-click the data of Column F > select Format Cells.

• Eventually, a Format Cells window will appear.
• Secondly, go to Number > select Custom > choose m/d/yyyy h:mm in the Type
• Finally, click OK.

• Consequently, weâ€™ll see the output like this.

Read More: How to Sort and Filter Data in Excel

## 4. Applying Excel MID and SEARCH Functions to Sort by Time & Date

If you need to sort the dataset from the given Delivery day-date-time data, what can you do?
Firstly, we have to lessen the name of the day from the data. And, we may insert the combination of MID and SEARCH functions for doing that.
The MID function returns the middle number from a given text string. The syntax of the function is.

`=MID (text, start_num, num_chars)`

The arguments are-
text â€“ The text to extract from.
start_num â€“ The location of the first character to extract.
num_chars â€“ The number of characters to extract.
Besides, the SEARCH returns the position of the first character of find_text inside within_text.

`=SEARCH (find_text, within_text, [start_num])`

The arguments are
find_text â€“ The text to find.
within_text â€“ The text to search within.
start_num â€“ [optional] Starting position in the text to search. Optional, defaults to 1.

• Now apply the following formula in the D5
`=MID(C5,SEARCH(", ",C5,1)+1,50)`

Here, C5 is the Delivery Day-Date-Time.

• Secondly, press ENTER.
• Thirdly, use the Fill Handle.

• Repeatedly, write the formula in the E5 cell to change Delivery Date-Time into a number using the VALUE function in order to sort them later.
`=VALUE(D5)`

• Thirdly, press ENTER and use the Fill Handle.

• Fourthly, to sort the values chronologically, firstly, copy cells E5:E16 and paste those to F5.

• Similarly, as before, you need to select the cells and Sort them and then use the Format Cells option to give the specific format.
• After doing this, youâ€™ll get the output like this.

## Things to Remember

• Donâ€™t forget that Excel stores date as serial numbers. If you get your desired output as a serial number, just change the format using the Format Cells option.
• Also, be careful about the sorted data whether the whole dataset is changed or not.

## Conclusion

Thatâ€™s all about todayâ€™s session. And these are the ways to Excel sort by date and time. We strongly believe this article would be highly beneficial for you. Donâ€™t forget to share your thoughts and queries in the comments section and explore our website ExcelDemy, a one-stop Excel solution provider.