To change cell color based on date in Excel, you can use the Manage Rules option under the Conditional Formatting dropdown menu within the Home tab.

The following example shows how to use this option in practice.
Example: How to Change Cell Color Based on Date in Excel
Suppose we have the following column of dates in Excel:

This article is being written on 11/20/2023.
Suppose we would like to change the color of the cells in column A based on the following rules:
- If the date is within 5 days or less, make the color red.
- Else, if the date is within 30 days or less, make the color yellow.
- Else, if the date is greater than 30 days away, make the color green.
To apply these rules, highlight the range A2:A11, then click the Conditional Formatting dropdown menu on the Home tab, then click Manage Rules:

In the new window that appears, click the New Rule button:

Then click Use a formula to determine which cells to format, then type =A2<=TODAY()+5 in the box, then click the Format button and choose a red fill color.

Lastly, click OK.
Repeat these steps to apply the other two rules.
In the Conditional Formatting Rules Manager panel, we’ll be able to see all three rules:

Then click OK.
The cells will have now have a specific color based on the date:

Note: In this example we used three rules but you can use the same process to apply as many rules as you’d like.
Additional Resources
The following tutorials explain how to perform other common operations in Excel:
Excel: Apply Conditional Formatting Based on Multiple Text Values
Excel: Apply Conditional Formatting Based on Multiple Conditions
Excel: Apply Conditional Formatting if Cell is Between Two Dates
Good afternoon,
I am having some issues trying to figure out some formulas and I was hoping you and your team could help. I have a log that i have dates in the first column. I would like anything in that column over 7 days to change to a color, anything at 4 days to turn another color. I have figured out that part, but i would also like for the 7 day and over cell to turn back to white after the supervisor has been resolved.
Hi Valeri…You can achieve this in Excel using **Conditional Formatting** with formulas. Here’s how you can do it:
### **Steps:**
1. Select the range in **Column A** (assuming your dates start from **A2** down).
2. Click **Home** > **Conditional Formatting** > **New Rule**.
3. Select **”Use a formula to determine which cells to format”**.
4. Enter the formula for each condition.
5. Click **Format**, set the desired color, and press **OK**.
—
### **Formulas for Conditions**
#### **1. More than 7 Days (e.g., turns Red)**
“`excel
=AND(TODAY()-A2>7, B2=””)
“`
– This checks if the date is **older than 7 days** and **not resolved (B2 is empty)**.
– Format this with **Red Fill**.
#### **2. Exactly 4 Days (e.g., turns Yellow)**
“`excel
=AND(TODAY()-A2=4, B2=””)
“`
– This highlights items that are **exactly 4 days old** and **not resolved**.
– Format this with **Yellow Fill**.
#### **3. Return to White (when Resolved)**
“`excel
=B2<>“”
“`
– This ensures that **once a supervisor resolves it** (assuming Column B has a resolution entry), the cell returns to its default color.
– Format this with **No Fill**.
—
### **Additional Notes:**
– Ensure **Column A** contains valid **date values** (not text).
– Column **B** should have any non-empty value (e.g., “Resolved”, “Checked”) to clear the highlight.
– If your dates include future dates, modify the formulas accordingly.
—
Good morning,
Thank you for your quick reply!! I tried to add a snip of the headers and formulas I am using but it’s not letting me paste it in this box. I am still having issues getting the original date to go back to white after the supervisor approved it. Is there anyway i can send a snip of the headers and the formulas I am using so you can see them?
You’re very welcome! I’d be happy to help further.
Since you can’t paste an image directly here, here are a few options you can use:
### ✅ Option 1: Upload the Snip
You can **upload a screenshot** or a small Excel file directly in this chat. Just use the file upload button (📎 or image icon) to share your snip or Excel file.
### ✅ Option 2: Describe the Layout
If you’re unable to upload, just let me know:
– The column headers involved (e.g., `Date Submitted`, `Approved`, etc.)
– What formula(s) you’re using in Conditional Formatting
– What conditions you’re trying to implement (e.g., “If the date is older than 7 days AND not approved, color it red; else make it white”)
Once I see the actual logic and layout, I’ll guide you to adjust the conditional formatting so the color reverts to white when approved.
Looking forward to seeing the snip or details!
I am having some issues because I have multiple sections on an excel file that need to be color coded. The Dates are located starting in G5 and H5. G5 is the date the document was received and H5 is the date that the document was returned to the sender. I used your formula above but when I am inputting dates in other boxes they are seeming to refer to H5. For example, G6 is corresponding to H5 as well and not H6. Do I need to go line by line to correct this?
Hi Mark…No, you *don’t* need to go line by line — this is likely just a referencing issue in your conditional formatting formula.
### Problem:
You’re probably using an **absolute reference** like `$H$5` instead of a **relative reference** like `H5`. This causes every row to always refer to H5, even as you go down the sheet.
—
### ✅ Solution:
Update your conditional formatting **formula** to use **relative row references**.
For example, instead of:
“`
=AND(G5<>“”, H5=””, TODAY()-G5>5)
“`
Use this when applying the rule to **multiple rows**:
“`
=AND(G5<>“”, H5=””, TODAY()-G5>5)
“`
Now make sure:
– You **apply the formula starting at G5**, but **select the entire range**, like `G5:H100` (or however far your data goes).
– Don’t use **$G$5 or $H$5**, unless you want to lock it to that specific cell.
—
### How to Apply it Correctly:
1. Select the range you want to apply formatting to (e.g., `G5:H100`).
2. Go to **Home > Conditional Formatting > New Rule > Use a formula to determine which cells to format**.
3. Paste the formula (with relative references) like:
“`
=AND(G5<>“”, H5=””, TODAY()-G5>5)
“`
4. Set your desired formatting (e.g., fill color).
5. Click OK.
—
Good evening James,
I wanted to check in to see if you had received my reply with the headers and formulas I used. I replied yesterday and I am not seeing it here. Please let me know when you have a moment.
Thank you,
Val
Hi Valeri…My apologies. Please remind me of your questions and concepts you would like to either clarify or discuss.