How to Sort Mixed Excel Date Values Correctly
Question details
The user needs to sort dates exported from web reports that are a mixture of valid Excel dates and text values.

- Product
- Spreadsheet
- Device & OS
- not provided
- Scenario
- Sorting data exported from web reports where dates are improperly formatted and inconsistent.
- Observed behavior
- Sorting fails to order dates chronologically, and attempting to convert them results in DATEVALUE errors due to mixed text and date formats.
Select your column of mixed dates and expand the column width to clearly see how the dates are aligned; by default, valid dates align to the right, while text dates align to the left.
Convert Mixed Dates using Text to Columns
Use the Text to Columns feature to quickly force the spreadsheet to recognize mixed text and date formats as uniform valid date values.
This is the most efficient method for cleaning up exported data without needing to write complex formulas. It overrides text formatting and standardizes the entire column.
Highlight the entire column containing the mixed text and date values.
Navigate to the 'Data' tab on the top ribbon and click on 'Text to Columns'.
Choose 'Delimited' in the first step and click 'Next' twice to reach Step 3 of the wizard.
Select the 'Date' radio button, choose the correct format (e.g., MDY or DMY) that matches the text layout of your data, and click 'Finish'.
Select the newly converted column, go to the 'Home' tab to apply a uniform 'Short Date' format, and use the 'Sort' function to arrange the data chronologically.
Use Formulas to Standardize Date Formats
Create a helper column using functions to convert text strings to date serial numbers safely while preserving existing valid dates.
Sort and Convert Complex Data Easily in WPS Spreadsheet
WPS Spreadsheet provides powerful data processing tools, including an advanced Text to Columns wizard and robust formula calculation capabilities, to effortlessly fix mixed date values and DATEVALUE errors.
- 1. Open Your File: Open your exported web report or dataset in WPS Spreadsheet.
- 2. Select the Column: Highlight the column that contains the mixed date formats.
- 3. Use Text to Columns: Navigate to the 'Data' tab, select 'Text to Columns', and follow the prompt to set the data format to 'Date'.
- 4. Sort the Data: Click 'Sort' under the 'Data' tab to arrange your freshly standardized dates chronologically.

Frequently Asked Questions
Why do some exported dates appear as text?
Web systems and databases often export data in plain text formats to preserve visual formatting. If the spreadsheet application doesn't recognize the specific text pattern as a local system date format, it leaves the cell formatted as a text string instead of converting it to a date serial number.
How can I easily spot text dates in a column?
Without manually checking cell formats or formulas, you can widen the column. By default, spreadsheet applications align text strings to the left side of the cell and numerical values (which includes valid dates) to the right side.
Why am I getting a DATEVALUE error when converting dates?
The DATEVALUE function expects a text string that looks like a date. If you target a cell that already contains a valid numeric date, or if the text format is completely unrecognizable, it will return a #VALUE! error. Using the IFERROR function helps bypass this issue.




