For common periods, select the dates and go to Home → Conditional Formatting → Highlight Cells Rules → A Date Occurring. Pick an option such as Today, In the last 7 days, This week, Last month or Next month, choose a format and click OK. These rules move with the calendar, so the highlights update each day.
For any other period, use Conditional Formatting → New Rule → Use a formula to determine which cells to format and write the formula for the first selected cell. Older than 30 days: =AND($A2<>"",$A2<=TODAY()-30). Due in the next 7 days: =AND($A2>=TODAY(),$A2<=TODAY()+7). Between 30 and 45 days ago: =AND($A2>=TODAY()-45,$A2<=TODAY()-30).
Keep the $A2<>"" check in any “older than” rule: an empty cell counts as day zero, so without it every blank cell is treated as a very old date and gets highlighted. To compare with a date typed in a cell, use =AND($C$1<>"",$A2>=$C$1); changing C1 updates the highlights.
For weekends use =WEEKDAY($A2,2)>5, and for weekdays =WEEKDAY($A2,2)<=5. With return type 2, Monday is 1 and Sunday is 7, so <5 would leave out Fridays.
When you stack rules for 30, 60 and 90 days, put the 90-day rule at the top of Conditional Formatting → Manage Rules: a date older than 90 days also passes the 30 and 60-day tests, and the highest rule’s colour wins. If nothing highlights at all, the dates are probably text; a real date turns into a number when you apply the General format.
With Conditional Formatting in Excel, you can use dates to create a rule for highlighting cells. There are some pre-built rules that you can use to highlight the cells quickly. And there is also a way to create a custom rule based on a date. In this tutorial, we will learn to use both ways in detail.
Steps to Use Dates for Conditional Formatting
- Select the data where you have dates.
- Go to Home > Conditional Formatting > Highlight Cells Rules.
- From there, click on the option “A date occurring”.
- In the dialog box, select the rule you want to use.
- In the end, click OK to apply.

And the moment you click OK, it highlights all the cells where you have the date occurring in the current month. With the same dialog box, you have more options to use with the dates: Yesterday, Today, Tomorrow, In the last 7 days, Last week, This week, Next week, Last month, This month and Next month.

Create a Custom Rule Based on Dates
There could be situations when you need to apply a conditional formatting rule, but that rule is not there. Well, you can create a custom rule with a formula. Go to Home > Conditional Formatting > New Rule.
Highlight Dates Older than 30 Days, 60 Days, and 90 Days
- First, select the data, open the New Rule dialog box, click “Use a formula to determine which cells to format”, and enter one of these formulas.
- 30 Days Older: =$A1<=(TODAY()-30)
- 60 Days Older: =$A1<=(TODAY()-60)
- 90 Days Older: =$A1<=(TODAY()-90)
- After that, to specify the formatting, click on the “Format” button.
- Next, specify the formatting: cell color, font color, bold or italic.
- In the end, click OK.

You can see in the above example that we have used a formula to highlight dates older than 30 days from the current date.
There’s one catch with these formulas: an empty cell counts as a date of 0, so blank cells in the range get highlighted as “older than 30 days” too. To skip the blank cells, add a check with AND:
=AND($A1<>"",$A1<=TODAY()-30)
And if you use all three rules together, a 90-day-old date matches all three of them. Put the 90-day rule at the top in Manage Rules, so its format wins over the other two.
Highlight Weekdays and Weekend Dates
And using a formula (WEEKDAY), you can highlight dates that are weekends. You can see in the example below that the formula we have used highlights two dates. With 2 as the second argument, WEEKDAY returns 1 for Monday through 7 for Sunday, so 6 and 7 are the weekend.
=WEEKDAY($A1,2)>5

And if you want to highlight weekdays, use the formula below.
=WEEKDAY($A1,2)<6

Using Range of Dates in Excel
In the same way, if you want to highlight cells based on a date range, you can use the AND function to create a formula with two conditions.

=AND(A1>=(TODAY()-45),A1<=(TODAY()-30))
In the above example, we have created a range of dates from 45 days before today to 30 days before today.
Using a Date from Another Cell
Now, if you want to use the date in a cell, you need to refer to a cell where you have that date. See the example below; we have specified cell C1, where we have the date.

=IF($C$1<>"",$A1>=$C$1,FALSE)
In this way, you can create a dynamic rule, and changing the date in the cell will also change the highlighted cells.
Highlight Dates Due in the Next 7 Days
For due dates and deadlines, you can highlight the dates that fall between today and the next 7 days. Blank cells aren’t highlighted with this formula, as 0 is never on or after today:
=AND($A1>=TODAY(),$A1<=TODAY()+7)
To highlight the entire row instead of just the date, select all the columns of your data before you create the rule. The $ before A keeps every cell in the row checking the date in column A.
Frequently Asked Questions
Why is my date rule not highlighting anything?
Most likely, the dates are stored as text. Text dates can’t be compared with TODAY(). Convert them to real dates (for example, with Text to Columns or DATEVALUE) and the rule starts working.
Does the highlighting update every day?
Yes. TODAY() recalculates when you open the workbook or when the sheet recalculates, so a date moves into or out of the rule on its own as the days pass.
Why are blank cells highlighted?
An empty cell has the value 0, which Excel treats as a very old date. Add $A1<>”” inside AND, as shown above, to leave the blank cells out.

Written by
Puneet Gogia
Microsoft MVP — Excel · Founder, Excel Champs
Twelve years of teaching Excel, and a decade before that using it as a data analyst. Every tutorial here is written from a file I actually built.