Sort Records by Name and Date in Microsoft Access or Excel
Question details
Sort records by name and then by date within each name in Microsoft Access or Excel.

- Product
- Microsoft Access and Microsoft Excel
- Device & OS
- not provided
- Scenario
- A list or table contains name and date fields that need to be sorted using two levels.
- Observed behavior
- Records should be grouped by name, with dates ordered within each name.
Identify the columns or fields containing names and dates. In Excel, check that dates are stored as dates rather than text and that the data range has clear headers.
Use a Custom Sort in Microsoft Excel
Use this method to sort an Excel list by name first and date second.
Click any cell in the list, or select the full data range including its headers.
Choose Home > Sort & Filter > Custom Sort. Select My data has headers if the first row contains column headings.
In Sort by, choose the Name column and select the desired order, such as A to Z.
Click Add Level, choose the Date column under Then by, and select Oldest to Newest or Newest to Oldest.
Click OK to sort the complete rows by name and then by date.

Sort Name and Date Fields in a Microsoft Access Query
Use a query to sort records in an Access table by name and then by date.
Sort Names and Dates in WPS Spreadsheets
Use a multilevel sort in WPS Spreadsheets to group rows by name and order their dates. This option applies to spreadsheet data, not Access database queries.
- 1. Open the spreadsheet: Open WPS Spreadsheets and use Open to select the workbook containing the name and date columns.
- 2. Select the records: Select the full data range, including headers, so each row stays together.
- 3. Set the sort levels: Choose Data > Sort, select the Name column as the first sort key, and add the Date column as the next level.
- 4. Apply and save: Choose the order for each level, click OK, and use File > Save to save the sorted workbook.

Frequently Asked Questions
How do I sort dates within each name rather than sorting all dates together?
In Excel's Custom Sort dialog, set Name as the first level and Date as the second. In an Access query design grid, place Name to the left of Date and set the Sort row for both fields.
Can I sort names alphabetically and dates from newest to oldest?
Yes. In Excel, choose A to Z for the Name level and Newest to Oldest for the Date level. In Access, choose Ascending for Name and Descending for Date.
Why are my Excel dates sorting in an unexpected order?
The dates may be stored as text rather than actual date values. Check the Date column and convert text entries to dates before applying Home > Sort & Filter > Custom Sort again.
Does WPS Spreadsheets sort Access database queries?
No. Use Microsoft Access to sort an Access query. WPS Spreadsheets can sort the data if it is available in a supported spreadsheet file.




