How to Sort Times with AM and PM in a Word Table
Question details
The user needs to sort a list of 12-hour time values chronologically within a Word document table.

- Product
- Microsoft Word
- Device & OS
- not provided
- Scenario
- Sorting a table column containing time entries formatted with AM and PM designations.
- Observed behavior
- Word sorts afternoon times incorrectly because it treats the AM and PM values as plain text, resulting in a numerical or alphabetical sort instead of a chronological one.
Ensure all time values in your column follow a consistent format before attempting to sort, as mixed formatting can lead to unpredictable sorting results.
Use Word's Date and Time Formatting
Insert times using Word's built-in format recognition to ensure they are sorted chronologically.
By officially designating the cell contents as time values rather than plain text, Word can properly process the AM and PM markers.
Select the first cell in your time column. Navigate to the 'Insert' tab and click on the 'Date and Time' command.
Select a time format that explicitly includes AM/PM from the list and click 'OK'.
Copy this newly formatted time to the other cells in your column, then edit the numbers to reflect your actual time values.
Select the entire time column. Go to the 'Home' tab and click the 'Sort' button.
In the Sort dialog box, choose the correct column under 'Sort by', select 'Date' as the type, select 'No header row' (or 'Header row' if you have titles), and click 'OK'.

Sort the Table Using Excel
Leverage Excel's advanced data recognition to automatically sort the times, then paste the table back.
Convert to 24-Hour Time Format
Bypass the AM/PM text recognition issue entirely by converting your times to a 24-hour military time format.
Easily Manage and Sort Tables with WPS Writer
WPS Writer offers robust table management tools and seamless spreadsheet integration, allowing you to format, organize, and sort time values accurately without hassle.
- 1. Open your document: Launch WPS Writer and open the document containing your time table.
- 2. Format your times: Ensure your AM/PM times are uniformly typed so the software can recognize the time values.
- 3. Sort the table: Select the column, go to the 'Table Tools' tab, click 'Sort', choose 'Date' as your type, and apply the sort.

Frequently Asked Questions
Why does Word sort 1:00 PM before 9:00 AM?
Word often reads AM/PM times as plain text instead of actual chronological values. Alphabetically and numerically, '1' comes before '9', causing afternoon times starting with a 1 to appear first when sorted.
Can I separate AM and PM into a different column to fix the sorting?
Yes, placing the numerical time values in one column and the AM/PM designations in a separate adjacent column allows you to sort by the AM/PM column first, and then by the time column.
Is there a way to sort a table without affecting the header row?
Yes. When you open the Sort dialog box in Word, look at the bottom of the window and select the 'Header row' option. This ensures your column titles remain at the top and are excluded from the sort process.




