How to Use Custom Conditional Formatting Rules for Dates in Excel

What to Know

  • Excel supports several pre-set options such as dates, duplicate data, and values above or below the average value of a range of cells.
  • You can apply different formatting options such as color or when a value meets criteria that you have pre-set.

This article explains five different ways to use conditional formatting in Excel. Instructions apply to Excel 2019, 2016, 2013, 2010; Excel for Mac, Excel for Microsoft 365, and Excel Online.

How to Use Conditional Formatting

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, customize the conditional formatting by adding your own formula using one or more of Excel's date functions.

01
of 05

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

Excel cells with various dates in them

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.

This demo uses the current date, 40 days before the current date, 70 days before the current date, and 100 days before the current date to generate the results.

02
of 05

Check for Dates 30 Days Past Due

Excel creating a new conditional rule

In a blank Excel worksheet, highlight cells C1 to C4 to select them. This is the range to which the conditional formatting rules will be applied.

  1. Select Home > Conditional Formatting New Rule to open the New Formatting Rule dialog box.
  2. Choose Use a formula to determine which cells to format.
  3. In the Format values where this formula is true text box, enter the formula:
    =TODAY()-C1>30
    This formula checks to see if the dates in cells C1 to C4 are more than 30 days past.
  4. Select Format to open the Format Cells dialog box.
  5. Select the Fill tab to see the background fill color options.
  6. Select a background fill color.
  7. Select the Font tab to see font format options.
  8. Set the font color.
  9. Select OK twice to close the dialog boxes and return to the worksheet.
  10. The background color of cells C1 to C4 changes to the fill color chosen, even though there are no data in the cells.
03
of 05

Add a Rule for Dates More Than 60 days Past Due

Excel screenshot showing the Manage Rules option

Rather than repeat all the steps above to add the next two rules, use the Manage Rules option to add the additional rules all at once.

  1. Highlight cells C1 to C4, if necessary.
  2. Select Home > Conditional Formatting Manage Rules to open the Conditional Formatting Rules Manager dialog box.
  3. Select New Rule.
  4. Select Use a formula to determine which cells to format.
  5. In the Format values where this formula is true text box, enter the formula:
    =TODAY()-C1>60
    This formula checks to see if the dates in cells C1 to C4 are greater than 60 days past.
  6. Select Format to open the Format Cells dialog box.
  7. Select the Fill tab to see the background fill color options.
  8. Select a background fill color.
  9. Select OK twice to close the dialog box and return to the Conditional Formatting Rules Manager dialog box.
04
of 05

Add a Rule for Dates More Than 90 days Past Due

Excel screenshot showing the options for a new rule
  1. Highlight cells C1 to C4, if necessary.
  2. Select Home > Conditional Formatting Manage Rules to open the Conditional Formatting Rules Manager dialog box.
  3. Select New Rule.
  4. Select Use a formula to determine which cells to format.
  5. In the Format values where this formula is true, enter the formula:
    =TODAY()-C1>90
  6. This formula checks to see if the dates in cells C1 to C4 are greater than 90 days past.
  7. Select Format to open the Format Cells dialog box.
  8. Select the Fill tab to see the background fill color options.
  9. Select a background fill color.
  10. Select OK twice to close the dialog box and return to the Conditional Formatting Rules Manager dialog box.
  11. Select OK to close this dialog box and return to the worksheet.

The background color of cells C1 to C4 changes to the last fill color chosen.

05
of 05

Test the Conditional Formatting Rules

Excel conditional formatting date formula

Test the conditional formatting rules in cells C1 to C4 by entering the following dates:

  • Enter the current date in cell C1. The cell changes to the default white background with black text since none of the conditional formatting rules apply.
  • Enter the following formula in cell C2:
    =TODAY()-40
    This formula determines which date occurs 40 days before the current date. The cell is filled with the color you selected for the conditional formatting rule for dates more than 30 days past due.​
  • Enter the following formula in cell C3:
    =TODAY()-70
    This formula determines which date occurs 70 days before the current date. The cell is filled with the color you selected for the conditional formatting rule for dates more than 60 days past due.
  • Enter the following formula in cell C4:
    =TODAY()-100
    This formula determines which date occurs 100 days before the current date. The cell color changes to the color you selected for the conditional formatting rule for dates more than 90 days past due.
Was this page helpful?