Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Conditionally Formatting for Multiple Date Comparisons.

Conditionally Formatting for Multiple Date Comparisons

Written by Allen Wyatt (last updated December 7, 2023)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365


1

Bev is having a problem setting up a conditional format for some cells. What she wants to do is to format the cells so that if they contain a date before today, they will use a bold red font; if they contain a date after today, they will use a bold green font. Bev cannot get both conditions to work properly.

What is probably happening here is a frustrating artifact of the way that Excel parses the conditions you enter. Follow these steps to see what I mean:

  1. Select the range of dates to which you want the conditional format applied.
  2. With the Home tab of the ribbon displayed, click the Conditional Formatting option in the Styles group. Excel displays a palette of options related to conditional formatting.
  3. Choose Manage Rules. Excel displays the Conditional Formatting Rules Manager dialog box.
  4. Click New Rule. Excel displays the New Formatting Rule dialog box.
  5. In the Select a Rule Type area at the top of the dialog box, choose Format Only Cells that Contain. (See Figure 1.)
  6. Figure 1. The New Formatting Rule dialog box.

  7. In the Edit the Rule Description area, change the second drop-down list to Less Than.
  8. In the area just to the right of the drop-down list enter =TODAY().
  9. Click Format. Excel displays the Format Cells dialog box. Make sure the Font tab is displayed. Change the formatting for the font to bold red, then close the Format Cells dialog box.
  10. Click OK. Excel closes the New Formatting Rule dialog box and shows the rule in the Conditional Formatting Rules Manager dialog box.
  11. Click New Rule. Excel again displays the New Formatting Rule dialog box.
  12. In the Select a Rule Type area at the top of the dialog box, choose Format Only Cells that Contain.
  13. In the Edit the Rule Description area, change the second drop-down list to Greater Than.
  14. In the area just to the right of the drop-down list enter =TODAY().
  15. Click Format. Excel displays the Format Cells dialog box. Make sure the Font tab is displayed. Change the formatting for the font to bold green, then close the Format Cells dialog box.
  16. Click OK. Excel closes the New Formatting Rule dialog box and shows the second rule in the Conditional Formatting Rules Manager dialog box.
  17. Click the up and down arrows to move the rules you created to the order in which they should be evaluated.
  18. Click OK to close the Conditional Formatting Rules Manager dialog box.

Any dates prior to today will be bold red and any after today will be bold green. If the date is today's date, then it will not be formatted in any particular manner.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (12929) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365. You can find a version of this tip for the older menu interface of Excel here: Conditionally Formatting for Multiple Date Comparisons.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Inserting Summary Information

Want to insert into your document those snippets of information that you know Word maintains about your document? It's ...

Discover More

Adding Pop-Up Documentation to a Cell

Want to have a small help screen pop up when a user selects a particular cell? This can be done by using data validation, ...

Discover More

Generating a List of Unique Words

Need to grab a list of unique words appearing in a document? You can tap the power of VBA's Words collection to perform ...

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!

More ExcelTips (ribbon)

Turning a Cell Red when a Threshold is Exceeded

Excel provides a great conditional formatting capability that allows you to change how a cell appears based on critiera ...

Discover More

Sorting Conditional Formats Properly

Conditional formatting can be a great tool to get your data looking just the way you need. However, when you sort data ...

Discover More

Highlighting Greater Than Average Dry Durations

If you need to find whether the duration between two dates is greater than the average of all durations, you'll find the ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is two more than 7?

2019-07-09 07:25:21

Richard

While I understand the steps presented, I don't understand the significance of the phrase "What is probably happening here is a frustrating artifact of the way that Excel parses the conditions you enter."
I thought you would have illustrated Bev's problem but it appears that you have simply shown a solution.


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.