Skip to main content

How to apply conditional formatting based on dates in Excel?

Author: Sun Last Modified: 2024-11-14

As we know, Conditional Formatting can automatically change cell formats based on the cell contents. In this tutorial, I will introduce how to apply conditional formatting to cells based on dates in Excel.

Conditional formatting for dates equal to/greater than/older than TODAY

Conditional formatting for past dates

Conditional formatting for future dates

Conditional formatting for dates between two specific dates

Conditional formatting based on dates in another column


Conditional formatting for dates equal to/greater than/older than TODAY

To apply conditional formatting for dates, you need to create a new rule.

1. Select the cells you want to add the conditional formatting, click Home > Conditional Formatting > New Rule.
A screenshot of the Conditional Formatting > New Rule menu in Excel

2. In the New Formatting Rule dialog, select Use a formula to determine which cells to format in Select a Rule Type section, then choose one formula as you need to type in Format values where this formula is true text box.

  • Equal to today: =$B2=TODAY()
  • Greater than today: =$B2>TODAY()
  • Older than today: =$B2<TODAY()

A screenshot of the New Formatting Rule dialog in Excel with the Use a formula to determine which cells to format option selected

3. Click Format to go to Format Cells dialog, select one format you want to highlight the cells as you need.
A screenshot of the Format Cells dialog in Excel

4. Click OK > OK. The dates have been formatted.

Note: The date today is 15/8/2018.
A screenshot of the formatted cells based on the conditional formatting rules in Excel


Conditional formatting for past dates

If you want to apply conditional formatting for the past dates, you can do as follows in the New Formatting Rule dialog.

1. Select one of below formulas as you need, and type it into the Format values where this formula is true text box.

  • More than 30 days ago: =TODAY()-$B2>30
  • From 30 to 15 days ago, inclusive: =AND(TODAY()-$B2>=15, TODAY()-$B2<=30)
  • Less than 15 days ago: =AND(TODAY()-$B2>=1, TODAY()-$B2<15)

2. Then click Format to select one format in the Format Cells dialog.

3. Click OK > OK to close the dialogs.

Note: The date today is 15/8/2018.
A screenshot of the formatted cells based on the conditional formatting rules in Excel


Conditional formatting for future dates

To apply conditional formatting for future dates, you can do as these:

1. Select one of below formulas as you need, and type it into the Format values where this formula is true text box.

  • Will occur in more than 30 days from now: =$B2-TODAY()>30
  • In 30 to 15 days, inclusive: =AND($B2-TODAY()>=15, $B2-TODAY()<=30)
  • In less than 15 days: =AND($B2-TODAY()>=1, $B2-TODAY()<15)

2. Then click Format to select one format in the Format Cells dialog.

3. Click OK > OK to close the dialogs.


Conditional formatting for dates between two specific dates

To apply conditional formatting for dates between two specific dates, select the cells and use this formula, =AND($B2>=$D$2,$B2<=$E$2) D2 is the start date, E2 is the end date. Then format the cells with a format you need.

A screenshot showing the conditional formatting applied to cells in Excel between two dates
A screenshot of cells formatted based on conditional formatting rules for dates in Excel

Conditional formatting based on dates in another column

If you want to apply conditional formatting to cells based on the date in another column, you can do as these.

1. Supposing you want to highlight sales in column C while the relative dates in column B is 16/8/2018, please select column C range firstly.

2. Enable the New Formatting Rule dialog and type this formula =$B2=DATEVALUE("8/16/2018") into the Format values where this formula is true text box, then format the cells in Format Cells dialog.

A screenshot of the Format Cells dialog in Excel for formatting based on the date in another column
A screenshot of the New Formatting Rule dialog in Excel, highlighting the cells where the date is 16/8/2018

Note: In the above formulas, B2 is the first date cell of your selected date range.


Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions…
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more
Use Kutools in your preferred language – supports English, Spanish, German, French, Chinese, and 40+ others!

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!