To sort by time in Excel, follow these steps:
-
Select the range of cells containing time values
Highlight the column or range that contains the times you want to sort. Ensure that the data is in a proper time format recognized by Excel (e.g.,hh:mm:ss AM/PMorhh:mmin 24-hour format). -
Open the Sort dialog
-
On Windows, go to the Data tab on the Ribbon and click Sort.
-
On Mac, go to the Data menu and select Sort.
-
-
Choose the column to sort by
In the Sort dialog, select the column containing your time values in the Sort by dropdown menu. -
Select the sort order
-
Choose Oldest to Newest to sort from the earliest time to the latest.
-
Choose Newest to Oldest to sort from the latest time to the earliest.
-
-
Confirm and apply
Click OK to apply the sorting. Your time values will now appear in the chosen order.
Notes on sorting by time
-
Ensure all cells are formatted as Time. Excel may not sort correctly if some cells are formatted as Text.
-
To format, select the cells, right-click, choose Format Cells, select Time, and pick the desired format.
-
-
Include entire rows in your selection if your times are part of a dataset with other columns. This prevents misalignment of related data.
-
Hidden times or blanks
Blank cells are sorted at the end when sorting from oldest to newest and at the beginning when sorting from newest to oldest. -
AM and PM distinction
Excel correctly differentiates AM and PM in time sorting. For example,9:00 AMcomes before3:00 PMin ascending order. -
24-hour format handling
Times entered as14:30(2:30 PM) are sorted automatically in chronological order with other 24-hour formatted times.
Example
Suppose you have the following times in column A:
| Time |
|---|
| 2:15 PM |
| 9:30 AM |
| 11:45 AM |
| 1:00 PM |
Sorting from Oldest to Newest results in:
| Time |
|---|
| 9:30 AM |
| 11:45 AM |
| 1:00 PM |
| 2:15 PM |
Sorting from Newest to Oldest results in:
| Time |
|---|
| 2:15 PM |
| 1:00 PM |
| 11:45 AM |
| 9:30 AM |
This method ensures that your dataset remains consistent and times are chronologically ordered correctly.