How to sort by date in excel
Tutor 5 (120 Reviews)
Excel Tutor
Still stuck with a Excel question
Ask this expertAnswer
To sort by date in Excel, select the column containing dates, click the Data tab, then choose Sort A to Z (oldest to newest) or Sort Z to A (newest to oldest).
Selecting the Date Column
Click any cell within the column
that contains your dates. Excel automatically detects the range when you apply
sorting commands.
Using Quick Sort Buttons
Navigate to the Data tab on the
ribbon. Two sorting buttons appear in the Sort & Filter group:
- Sort Oldest to Newest -
arranges dates in ascending chronological order
- Sort Newest to Oldest -
arranges dates in descending chronological order
Click either button to immediately
sort your data.
Sorting a Table with Multiple Columns
Select any cell within your data
range before sorting. Excel treats connected data as a table and moves entire
rows together when sorting by date. This preserves the relationship between
dates and corresponding information in adjacent columns.
Opening the Sort Dialog Box
Click the Sort button in the Data
tab to access advanced sorting options. The dialog box allows you to:
- Choose which column to sort
by from the "Sort by" dropdown
- Select "Cell
Values" under the Sort On option
- Pick "Oldest to
Newest" or "Newest to Oldest" from the Order dropdown
- Add multiple sorting levels
using the "Add Level" button
Adding Multiple Sort Levels
Click "Add Level" in the
Sort dialog to create secondary sorting criteria. Excel sorts by the first
level, then applies subsequent levels to organize rows with identical values in
the previous level.
Example sorting sequence:
- First
level: Sort by Date (newest to oldest)
- Second
level: Sort by Department (A to Z)
- Third
level: Sort by Sales Amount (largest to smallest)
What Happens When Dates Are Formatted as Text
No, Excel cannot properly sort
dates formatted as text using standard date sorting. Text-formatted dates sort
alphabetically rather than chronologically, placing "12/1/2024"
before "2/15/2024" because "1" comes before "2"
alphabetically.
Convert text to dates before
sorting by:
- Selecting the cells with text
dates
- Clicking the warning icon
that appears
- Choosing "Convert to
Number"
Windows alternative: Use
the Text to Columns feature (Data tab > Text to Columns > Finish)
Mac alternative: Use
the same Text to Columns feature located in the Data tab
Sorting by Month or Year Only
Extract the month or year
component into a helper column, then sort by that column. Use these functions:
- MONTH(date) - returns the
month number (1-12)
- YEAR(date) - returns the
four-digit year
- TEXT(date,"mmmm") -
returns the full month name
Place the formula in a new column
adjacent to your dates, copy it down for all rows, then sort by the helper
column.
Fixing Dates That Won't Sort Correctly
Dates stored as serial numbers
sort correctly, while dates stored as text do not. Check the cell format by
selecting a date cell and viewing the Number Format box on the Home tab.
Conversion steps:
- Select the
problematic date cells
- Press
Ctrl+1 (Windows) or Cmd+1 (Mac) to open Format Cells
- Choose Date
from the Category list
- Select your
preferred date format
- Click OK
Sorting Dates Across Different Formats
Yes, Excel can sort dates in
different formats within the same column when all dates are stored as date
values rather than text. The display format (MM/DD/YYYY, DD-MMM-YY, etc.) does
not affect sorting because Excel stores all dates as serial numbers internally.
Standardize formats after sorting
by selecting the column, opening Format Cells (Ctrl+1 or Cmd+1), and choosing a
consistent date format.
Using Custom Sort Orders
Create a custom list for
non-standard date sorting through File > Options > Advanced > Edit
Custom Lists (Windows) or Excel > Preferences > Custom Lists (Mac). This
feature works for sorting by day names (Monday, Tuesday) or month names
(January, February) rather than chronological order.
Sorting Dates Within a Filtered Range
Apply an AutoFilter first by
selecting your data and clicking Filter in the Data tab. Click the dropdown
arrow in the date column header to access filtering options. The Sort Oldest to
Newest and Sort Newest to Oldest commands appear at the top of the filter menu
and sort only the visible (filtered) data.
Preserving Formulas When Sorting
Excel automatically adjusts
relative cell references in formulas when you sort data. Formulas in the same
row as the dates move together with their corresponding data. Absolute
references (using $ symbols) remain fixed to their original cell locations.
Undoing a Sort Operation
Press Ctrl+Z (Windows) or Cmd+Z
(Mac) immediately after sorting to reverse the operation. Excel maintains only
one level of undo for sorting, so save your workbook before performing complex
sorting operations on critical data.
Sorting Dates with Blank Cells
Excel places blank cells at the
bottom when sorting oldest to newest, and at the bottom when sorting newest to
oldest. Blank cells always appear last regardless of sort direction in date
columns.
Remove blank rows before sorting
by:
- Selecting your data range
- Pressing Ctrl+G (Windows) or
Fn+F5 (Mac)
- Clicking Special > Blanks
- Right-clicking any selected
blank cell
- Choosing Delete > Entire
Row
Can You Sort by Date in a Pivot Table
Yes, you can sort by date in a
pivot table by clicking the dropdown arrow next to the date field in the Row
Labels or Column Labels area, then selecting Sort Oldest to Newest or Sort
Newest to Oldest. Pivot tables maintain the sort order when you refresh the
data.
. Was this Helpful?
Get Online Tutoring or Questions answered by Experts.
You can post a question for a tutor or set up a tutoring session
Answers · 1
How to track changes in excel
Answers · 1
How to lock certain cells in excel
Answers · 1
How to merge two excel spreadsheets
Answers · 1
Where is the name box in excel
Answers · 1