Fix Excel Conditional Formatting When Dates Are Treated as Text
Question details
Conditional formatting rules based on dates fail to work correctly because the date values are being read as text strings instead of valid date numbers.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Applying a conditional formatting rule using the TODAY() function (e.g., =AND($E3="y",$D3>=TODAY())) to highlight specific rows based on date criteria.
- Observed behavior
- The rule incorrectly highlights older dates or fails to highlight target dates entirely because the application treats the dates in the reference column as plain text rather than numeric date values.
Verify whether your dates are actually formatted as text by clicking an empty cell and using the =ISTEXT(D3) or =ISNUMBER(D3) functions on one of your date cells.
Convert Text to Valid Dates and Reapply Conditional Formatting
Transform text-based dates into valid Excel serial numbers so conditional formatting formulas can evaluate them correctly.
Spreadsheet software requires dates to be stored as serial numbers to perform mathematical comparisons like >=TODAY(). If your dates contain text suffixes (like 'st', 'nd', 'rd', 'th'), they are inherently treated as text strings, breaking any logical date calculations.
Click an empty cell and type =ISTEXT(D3) (assuming D3 is the cell with the date). If it returns TRUE, the data is being stored as text.
Select your date column and press Ctrl+H to open the Find and Replace dialog. Type 'st' in the 'Find what' field, leave 'Replace with' blank, and click 'Replace All'. Repeat this process for 'nd', 'rd', and 'th'.
With the cleaned column still selected, navigate to the Data tab and click 'Text to Columns'. Keep the default settings and simply click 'Finish'. This forces the application to evaluate the column into standard numeric date formats.
Select the data range you want to highlight. Go to Home > Conditional Formatting > New Rule > Use a formula to determine which cells to format. Enter your formula exactly as =AND($E3="y",$D3>=TODAY()) and choose your preferred highlight color.

Easily Manage Data and Conditional Formatting with WPS Spreadsheet
WPS Spreadsheet provides powerful and intuitive tools to clean text data, convert formats, and apply complex conditional formatting rules with zero hassle.
- 1. Open your file in WPS Spreadsheet: Launch WPS Office and open the workbook containing the text-formatted dates.
- 2. Clean the date column: Highlight the dates, press Ctrl+H to remove any text suffixes, and use the Data tab's 'Text to Columns' feature to convert them into real dates.
- 3. Set the formatting rule: Navigate to Home > Conditional Formatting > New Rule, select the formula option, and input your date-checking formula to instantly highlight the correct data.

Frequently Asked Questions
Why does the =TODAY() function not work with my date column?
The TODAY() function returns a numeric serial number representing the current date. If your date column is formatted as text, the software cannot mathematically compare the text string to the numeric serial number, causing greater-than or less-than operators to fail.
How can I quickly visually identify text-formatted dates?
By default, spreadsheet software aligns text values to the left side of a cell and numeric values (including valid dates) to the right. If your dates are left-aligned without any manual alignment applied, they are likely stored as text.
Is the IF function necessary in a conditional formatting formula?
No, the IF function is completely unnecessary. Conditional formatting rules naturally look for a TRUE or FALSE outcome. Using logical functions like AND or OR is entirely sufficient to trigger the desired formatting.




