How to Use Custom Conditional Formatting Rules for Dates in Excel

Adding conditional formatting to a cell in Excel allows you to apply different formatting options, such as color, when the data in that cell meet the conditions that you have set. 

To make conditional formatting easier, Excel supports pre-set options that cover commonly used situations, such as:

In the case of dates, the pre-set options simplify the process of checking your data for dates close to the current date — such as yesterday, tomorrow, last week, or next month.

If you want to check for dates that fall outside of the listed options, however, you can customize conditional formatting by adding your own formula using one or more of Excel's date functions.

01
of 06

Checking for Dates 30, 60, and 90 Days Past Due

Excel Conditional Formatting Date Formula
Ted French

Customize conditional formatting using formulas by setting a new rule that Excel follows when evaluating the data in a cell.

Excel applies conditional formatting in top-to-bottom order as they appear in the Conditional Formatting Rules Manager dialog box.

Even though several rules may apply to some cells, the first rule that meets the condition is applied to the cells.

02
of 06

Checking for Dates 30 Days Past Due

Highlight cells C1 to C4 to select them. This is the range to which we will apply the conditional formatting rules

  1. Click Home > Conditional Formatting New Rule to open the New Formatting Rule dialog box.
  2. Click the Use a Formula to determine which cells to format option.
  3. Enter the following formula into the box below the Format values where this value is true option in the bottom half of the dialog box:
    =TODAY()-C1 >30
    This formula checks to see if the dates in cells C1 to C4 are more than 30 days past
  4. Click the Format button to open the Format Cells dialog box.
  5. Click the Fill tab to see the background fill color options.
  6. Select a background fill color.
  7. Click the Font tab to see font format options
  8. Set the font color.
  9. Click OK twice to close the dialog box and return to the worksheet.
  10. The background color of cells C1 to C4 will change to the fill color chosen, even though there are no data in the cells.
03
of 06

Adding a Rule for Dates More Than 60 days Past Due

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

  1. Highlight cells C1 to C4, if necessary.
  2. Click Home > Conditional Formatting Manage Rules to open the Conditional Formatting Rules Manager dialog box.
  3. Click the New Rule option in the top left corner of the dialog box
  4. Click the Use a Formula to determine which cells to format option from the list at the top of the dialog box.
  5. Enter the following formula into the box below the Format values where this value is 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.

  6. Click the Format button to open the Format Cells dialog box.
  7. Click the Fill tab to see the background fill color options.
  8. Select a background fill color.
  9. Click OK twice to close the dialog box and return to the Conditional Formatting Rules Manager dialog box.
04
of 06

Adding a Rule for Dates More Than 90 days Past Due

Repeat steps five through seven to add a new rule.

  1. For the formula use:
    =TODAY()-C1>90
  2. Select a background fill color.
  3. Set the font color.
  4. Click OK twice to close the dialog box and return to the Conditional Formatting Rules Manager dialog box
  5. Click OK again to close this dialog box and return to the worksheet.
  6. The background color of cells C1 to C4 will change to the last fill color chosen.
05
of 06

Testing the Conditional Formatting Rules

Excel Conditional Formatting Date Formula

Ted French

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. 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 a yellow background with white text.
  • 100 days before the current date—the cell should change to a dark red background with white text.
06
of 06

Alternative Conditional Formatting Rules

If your worksheet already displays the current date — and many worksheets do — an alternative formula uses a cell reference to the cell where the current date is displayed rather than using the TODAY function.

For example, if the date 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 prevent 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 a #REF! error message.