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

Columns in a Text Box

Want to divide a text box into columns? Word doesn't allow you to do this, but there are ways to work around the limitation.

Discover More

Leaving Even Pages Blank

Want to print your document only on odd-numbered pages in a printout? There are a couple of things you can try, as ...

Discover More

Quickly Finding Synonyms

If you need to find some synonyms for a specific word in your document, here's how you can do it. (Hint: All you need to ...

Discover More

Program Successfully in Excel! John Walkenbach's name is synonymous with excellence in deciphering complex technical topics. With this comprehensive guide, "Mr. Spreadsheet" shows how to maximize your Excel experience using professional spreadsheet application development tips from his own personal bookshelf. Check out Excel 2013 Power Programming with VBA today!

More ExcelTips (ribbon)

Converting Conditional Formatting to Regular Formatting

Conditional formatting allows you to change how information is displayed based on rules you define. What if you want to ...

Discover More

Coloring Identical Company Names

Want to know where duplicates are in a list of names? There are a couple of ways you can go about identifying the ...

Discover More

Comparing Dollar Values in a Conditional Formatting Rule

Comparing values (like is done in conditional formatting rules) can yield some crazy results at times. This tip looks at ...

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 8 + 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.