How to apply conditional formatting based on dates in Excel?
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.
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()
3. Click Format to go to Format Cells dialog, select one format you want to highlight the cells as you need.
4. Click OK > OK. The dates have been formatted.
Note: The date today is 15/8/2018.
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.
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.
![]() |
![]() |
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.
![]() |
![]() |
Note: In the above formulas, B2 is the first date cell of your selected date range.
Best Office Productivity Tools
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!