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

Positioning a Graphic in a Macro

Macros are a great way to process information in a worksheet. Part of that processing may involve moving graphics around ...

Discover More

Using Manual Line Breaks with Justified Paragraphs

If you use justified paragraphs, you know that if you press Shift+Enter, it can lead to some odd spacing between words ...

Discover More

How Word Applies Styles

Styles are a great boon for applying styles in a powerfully consistent manner. How Word applies styles, however, depends ...

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)

Alerts About Approaching Due Dates

You may use Excel to track due dates for a variety of purposes. As a due date approaches, you may want that fact drawn to ...

Discover More

Automatic Lines for Dividing Lists

When preparing a report for others to use, it is not unusual to add a horizontal line between major sections of the ...

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
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 five more than 3?

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.