1. Computing

Excel Conditional Formatting Date Formula

By

2 of 2

Conditional Formatting For Dates Example Continued
Excel Conditional Formatting Date Formula

Excel Conditional Formatting Date Formula

© Ted French

Entering the Next Two Conditional Format Rules Using the Manage Rules Option

Rather than repeat all the steps above to add the next two rules, we will make use of the Manage Rules option which will allow us to add the additional rules all at once.

Adding a Rule for Dates More Than 60 days Past Due

  1. Highlight cells C1 to C4 if necessary

  2. Click on the Home tab of the ribbon

  3. Click on the Conditional Formatting icon to open the drop down menu

  4. Choose the Manage Rules option to open the Conditional Formatting Rules Manager dialog box

  5. Click on the New Rule option in the top left corner of the dialog box

  6. Click on the Use a Formula to determine which cells to format option from the list at the top of the dialog box

  7. Enter the following formula in to the box below the Format values where this value is true option in the bottom half of the dialog box:

    =TODAY()-C1>60

    This formula checks to see if the dates in cells C1 to C4 are greater than 60 days past

  8. Click the Format button to open the Format Cells dialog box

  9. Click the Fill tab to see the background fill color options

  10. Select a background fill color - to match the example in this tutorial, choose yellow

  11. Click OK twice to close the dialog box and return to the Conditional Formatting Rules Manager dialog box

Adding a Rule for Dates More Than 90 days Past Due

  1. Repeat steps 5 to 7 above to add a new rule

  2. For the formula use

    =TODAY()-C1>90

  3. Select a background fill color - to match the example in this tutorial, choose orange

  4. Set the font color to white to match this tutorial

  5. Click OK twice to close the dialog box and return to the Conditional Formatting Rules Manager dialog box

  6. Click OK again to close this dialog box and return to the worksheet

  7. The background color of cells C1 to C4 will change to the last fill color chosen

Testing the Conditional Formatting Rules

As can be seen in the image above, we can test the conditional formatting rules in cells C1 to C4, by entering the following dates:

  • the current date - the cell should change to the default white background with black text - since none of the conditional formatting rules apply
  • 40 days before the current date - the cell should change to a light green background with white text
  • (Note: If you are having trouble calculating such a date, as seen in the image above, the formula =TODAY() - 40 will enter the date 40 days prior to the current date)
  • 70 days before the current date - the cell should change to an yellow background with white text
  • 100 days before the current date - the cell should change to a dark red background with white text

Alternative Conditional Formatting Rules

If your worksheet already displays the current date - and most worksheets do - an alternative formula to those above can use the cell reference to the cell where the current date is displayed rather than using the TODAY function.

For example, if the date is displayed in cell B4, the formula entered as the rule to conditionally format dates that are more than 30 days past due could be:

                      =$B$4 > 30 

The dollar signs ( $ ) surrounding the cell reference B4 prevents the cell reference from changing if the conditional formatting rule is copied to other cells in the worksheet.

The dollar signs create what is known as an absolute cell reference.

If the dollar signs are omitted and the conditional formatting rule is copied, the destination cell or cells will most likely display an #REF! error message.

©2014 About.com. All rights reserved.