Excel/Conditional Text


QUESTION: I am working in Excel 2010, in shared workbook.
I have an excel file with a column with the required delivery date and another column with the real delivery date. I want to highlight in red if the real delivery date is later than the required delivery date so I've set up 3 conditions:
1. If cell is blank set no format
2. If cell (real delivery) is equal to required delivery cell, set no format 3. If cell (real delivery) is greater than required delivery, fill red.

If, for instance, I have 31/8 in the required delivery date and the same in the real delivery date, then conditional works ok.
But if I have 1/9 in the required delivery date and I set the same date or any later date in the real delivery date, then cells turn red.

Am I using the wrong conditions?
How can I solve this problem?

ANSWER: Esther,

one possibility is that your cells contain strings that look like dates rather than being stored as actual excel date serial numbers.  If you select the cells and format them as general do they still look like  31/8 and 1/9  or do they look like 42247 and 42248.  The later is what they should look like if you actually have dates entered (assuming year of 2015).  You can see for real dates that Aug 8 is before Sept 1  (42247 < 42248)

If they are strings then you can enter the below formula to see that


it returns True.  That is because it is performing a string compare - character by character and 3 in 31 is greater than 1.  

I am guessing this is your situation.  So enter your dates as full dates and make sure they are stored as dates.

Also, if you are not going to alter the format for two of your conditions, you don't need to enter rules for that.  You only need to enter a rule for the condition that turns red.

Tom Ogilvy

---------- FOLLOW-UP ----------

conditiona rules
conditiona rules  

QUESTION: Hello again! I checked your suggestion but I have the correct format in all columns. Everything is set as date so i do not understand why it does not work. I have tried to delete the conditions that are not necessary just in case, (for blank and smaller dates) but it still does not work.


Best I can offer is to look at your worksheet if you want to share it with me.  You can make a dummy worksheet that reproduces the problem (and remove any company confidential data) if you wish.  You can send it to twogilvy@msn.com   (tomorrow I am traveling so the sooner the better if you are going to send it).

Tom Ogilvy

About Excel
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here


All Answers

Answers by Expert:

Ask Experts


Tom Ogilvy


Selected as an Excel MVP by Microsoft since 1999. Answering Excel questions in Allexperts since its inception in 2001. Able to answer questions on almost all aspects of Excel's internal capabilities. If seeking a VBA solution, please specify that in your question itself so I give you the answer you want. [Excel has weak protection - if you are distributing an application, I don't answer questions on how to protect your project from your users.]


Extensive experience.

Master of Science (MS) degree Operations Research (ORSA)

Awards and Honors
Microsoft MVP in Excel.

©2017 About.com. All rights reserved.