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

Seeing Where Bookmarks Are

Bookmarks can be great for referencing and finding portions of your document. If you want to easily see where the ...

Discover More

Dynamic Headers and Footers

Do you want to change the headers and footers that appear on different pages of your printout? Here's how you can get ...

Discover More

Excel 2016 PivotTables for the Faint of Heart (Table of Contents)

PivotTables are a powerful tool for consolidating huge amounts of data. PivotTables 2016 for the Faint of Heart ...

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)

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

Returning a Value Based on Text Color

Conditional formatting rules can be used to adjust the way in which information is displayed in Excel, such as the text ...

Discover More

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
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 six minus 4?

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.