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

Dynamic Hyperlinks in Excel

Hyperlinks to many types of Web sites rely on passing parameters in the URL. Knowing this, you can construct a dynamic ...

Discover More

Dealing with Large Numbers of Seconds

When adding values to a time to calculate a new time, you may naturally choose to use the TIME function. This can cause ...

Discover More

Adjusting How Quickly Your Keyboard Responds

Does your keyboard seem a bit sluggish or a bit too quick when you hold down keys? You can adjust how the keyboard ...

Discover More

Excel Smarts for Beginners! Featuring the friendly and trusted For Dummies style, this popular guide shows beginners how to get up and running with Excel while also helping more experienced users get comfortable with the newest features. Check out Excel 2013 For Dummies today!

More ExcelTips (ribbon)

Applying Conditional Formatting to Multiple Worksheets

If you just updated your copy of Excel, you may have noticed some differences in how the program handles applying ...

Discover More

Controlling Data Entry in a Cell

Sometimes you want whatever is displayed in one cell to control what is displayed in a different cell. This tip looks at ...

Discover More

Conditionally Formatting for a Pattern

Conditional formatting is a great tool you can use to customzie your worksheets. When you want to test whether a value in ...

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 2 + 8?

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.