To sort by date in Excel Online (Excel for the web), click a cell in the date column, go to the Data tab, and click Sort Ascending for earliest to latest or Sort Descending for latest to earliest. Excel moves each whole row along with its date. In the Windows desktop app, the same buttons are labeled Sort Oldest to Newest and Sort Newest to Oldest.
These steps come from the Web and Windows tabs of Microsoft’s Sort data in a range or table in Excel. The text-date fixes come from Microsoft’s Convert dates stored as text to dates, and the sort-order rules from Microsoft’s older Sort data in a workbook in the browser page.
How to sort by date in Excel Online
- Open your workbook in Excel for the web.
- Click a cell in the date column. If your data has a header row, Microsoft says you can pick the header cell.
- Go to the Data tab.
- Click Sort Ascending (earliest to latest date) or Sort Descending (latest to earliest date).
The rows are reordered by date. Microsoft says to use the Undo button on the Home tab if you want to put them back.

Sort Dates in Desktop Excel
Save a copy first if the worksheet contains important records.
- Select a cell in the date column within the complete list. Keep names, dates and other related fields together.
- Open Data and select Sort Oldest to Newest or Sort Newest to Oldest.
- If Excel asks which cells to sort, choose Expand the selection so the other columns move with their dates.
- Check the first and last records. If the order is wrong, undo the sort and use the text-date fixes below.
If your data is formatted as an Excel table, Microsoft says each column header has a filter button. Select the filter button on the date column and pick the sort order you want. If your data isn’t a table yet, formatting it as one adds those buttons automatically.
How to sort by date and another column
- Select any cell in your data.
- On the Data tab, select Custom Sort.
- Under Sort by, choose the first column, and under Order choose Sort Ascending or Sort Descending.
- Select Add to add another column, and set its order.
- Use the Up or Down arrows to change which column sorts first, then confirm.
Excel sorts by the first column, then by the next one within each group. Microsoft notes the Sort On menu (for sorting by color) isn’t supported in Excel for the web yet, so use the desktop app for that. In the desktop app, the button for a new level is called Add Level.
Why won’t my dates sort correctly?
Microsoft says dates must be stored as date serial numbers to sort correctly; if Excel doesn’t recognize a value as a date, it’s stored as text and sorts out of order. Microsoft notes text dates usually sit left-aligned in the cell instead of right-aligned.
- Convert with DATEVALUE: in a blank cell with General format, enter =DATEVALUE(, select the text date, type ), and press Enter. Copy the results back over the text dates with Paste Special and apply a date format.
- Two-digit years: in the desktop app, select cells with the green error triangle, click the error button, and choose Convert XX to 20XX or Convert XX to 19XX.
- Blank cells and spaces: Microsoft’s browser sort page says blank cells always go last, and values with leading spaces sort before everything else.

Frequently asked questions
Can I sort by day of the week instead?
Microsoft suggests formatting the cells to show the day of the week. To sort by weekday regardless of the date, it says to convert the dates to text with the TEXT function, but the result then sorts alphabetically, not by date.
Does sorting change my dates?
No. Sorting reorders rows; the date values stay the same. Use Undo on the Home tab if you don’t like the result.
More Excel Guides
- How to hide columns in Excel Online
- Why does Excel keep changing my numbers to dates?
- How to download a copy of an Excel Online file

Matthew Burleigh is the founder, head writer, and editor of Solve Your Tech, which he launched in 2012. He has written technology tutorials since 2008 and worked in IT since 2003, including small-business support, IT management, and consulting. He holds Bachelor’s and Master’s degrees in Computer Science from Arizona State University.
Matthew writes practical guides for Windows, iPhone and iPad, Microsoft Office, Outlook, Google apps, and Android. Solve Your Tech’s guides are checked step by step against the device or app maker’s own documentation and tested on his own devices whenever he has the hardware or software, with clear steps, sources, and update dates.
Read more about Matthew and how Solve Your Tech writes and updates its guides, or report a correction.