Conditional Formatting Excel for Due Dates Guide
In this article
Conditional formatting for due dates in Excel allows you to automatically change the color of a cell based on how close a date is to today's date. This achieves a visual dashboard effect where overdue tasks turn red, upcoming deadlines turn yellow, and completed tasks turn green, ensuring you never miss a deadline. To do this, you will use a combination of the Conditional Formatting menu and the TODAY() function, which dynamically updates every time you open the spreadsheet.
What You'll Need
- Microsoft Excel (Desktop version for full functionality, though web versions support basic rules).
- A dataset containing a column of dates formatted as "Date" cells.
- A clear understanding of your "warning window" (e.g., do you want a warning 7 days before or 14 days before?).
Step-by-Step
- Prepare Your Data: Ensure your dates are in a single column. Select the range of cells containing the due dates. For example, if your dates are in cells B2 through B100, click and drag to highlight that specific area. It is important to select the range first so Excel knows exactly where to apply the logic.
- Open Conditional Formatting: Go to the Home tab on the top ribbon. In the Styles group, click on Conditional Formatting. A dropdown menu will appear with several options.
- Create the Overdue Rule (Red):
- Select New Rule from the dropdown.
- In the dialog box, select Use a formula to determine which cells to format.
- In the formula box, enter:
=B2<TODAY()(Replace "B2" with the first cell in your selected range). - Click the Format button. Go to the Fill tab and select a bright red color. You may also go to the Font tab and select white text for better contrast.
- Click OK, then OK again. Now, any date that is earlier than today's date will automatically turn red.
- Create the Upcoming Warning Rule (Yellow):
- With the same range still selected, go back to Conditional Formatting > New Rule.
- Select Use a formula to determine which cells to format.
- To highlight dates occurring within the next 7 days, enter:
=AND(B2>=TODAY(), B2<=TODAY()+7). - Click Format, go to the Fill tab, and select yellow.
- Click OK twice. This ensures that only dates in the immediate future are flagged, preventing the red rule from overlapping.
- Create the Safe/Future Rule (Green):
- Again, go to Conditional Formatting > New Rule.
- Select Use a formula to determine which cells to format.
- Enter the formula:
=B2>TODAY()+7. - Click Format, go to the Fill tab, and select green.
- Click OK twice. This marks all dates more than a week away as safe.
- Manage Rule Precedence: If the colors aren't appearing correctly, go to Conditional Formatting > Manage Rules. Ensure the rules are in the correct order. Excel processes these from top to bottom. If you have a rule that says "Any date" at the top, it will override your "Overdue" rule. Use the up and down arrows in the Manager to move the Red (Overdue) rule to the top.
Common Mistakes
One of the most frequent errors is using absolute references (with dollar signs) in the formula. If you enter =$B$2<TODAY(), Excel will look only at cell B2 for every single row in your selection, and the entire column will change color based on that one cell. Always use relative references (like B2) when you want the formatting to apply to each row individually.
Another common mistake is forgetting that Excel treats dates as numbers. If your "dates" are actually typed as text (e.g., "Jan 5th 2026") instead of using the date picker or standard date format (2026-01-05), the TODAY() function will not be able to perform the mathematical comparison, and the formatting will simply not trigger.
Users also often forget to handle blank cells. By default, Excel may treat a blank cell as a very small number, which is technically "less than today," causing all empty rows in your table to turn bright red. To fix this, you must add a condition to ignore blanks, such as =AND(B2<>"", B2<TODAY()).
Tips
To make your tracker even more powerful, consider adding a "Status" column (e.g., Pending, In Progress, Completed). You can modify your conditional formatting formulas to ignore the date once a task is marked "Completed." For example, use =AND(C2<>"Completed", B2<TODAY()). This prevents a task from staying red after you have already finished it.
If you want a more flexible warning system, instead of typing "7" directly into the formula, put the number 7 in a separate cell (like cell E1) and reference that cell in your formula: =AND(B2>=TODAY(), B2<=TODAY()+$E$1). Now, you can change the warning window from 7 days to 14 or 30 days just by changing one cell, without having to rewrite all your conditional formatting rules.
For those managing huge datasets, avoid applying conditional formatting to entire columns (e.g., clicking the "B" header). This can slow down your workbook's performance because Excel has to calculate the formula for over a million rows. Instead, apply it to a specific range or, better yet, convert your data range into an official Excel Table (Ctrl+T). When you use a Table, the conditional formatting automatically expands as you add new rows to the bottom.
Troubleshooting
If the colors are not appearing, first check the cell formatting. Select your date column, right-click, choose Format Cells, and ensure the category is set to Date. If the dates are aligned to the left of the cell, Excel is likely treating them as text, and you will need to convert them using the Data > Text to Columns tool.
If the wrong colors are showing, check the Manage Rules window. Ensure there are no conflicting rules. For example, if you have a rule that highlights all cells with a date and another that highlights overdue dates, the "all dates" rule might be taking priority. Check the "Stop If True" checkbox next to your highest priority rule to prevent Excel from evaluating lower-priority rules once a match is found.
If the date doesn't seem to update, remember that the TODAY() function is volatile. It updates when the workbook is recalculated or reopened. If you have "Manual Calculation" turned on in the Formulas tab, the colors won't update until you press F9 or save the file.
Frequently Asked Questions
Can I highlight the entire row instead of just the date cell?
Yes. Select the entire data range (e.g., A2 to Z100). When writing the formula, put a dollar sign before the column letter of the date (e.g., =$B2<TODAY()). This tells Excel to always look at column B to decide the color, but to apply that color across the entire row.
Does this work in Excel for Web?
Yes, the basic functionality of conditional formatting and the TODAY() function works in the web version. However, the interface for creating "New Rules" may look slightly different than the desktop version, and some advanced formatting options are limited.
How do I remove all the date formatting at once?
Select the range of cells, go to Conditional Formatting > Clear Rules, and select Clear Rules from Selected Cells. This will strip all colors without deleting your actual date data.
Can I use this for dates in the past that aren't "due dates"?
Absolutely. The logic is purely mathematical. You can use the same formulas to highlight birthdays, anniversary dates, or historical milestones by simply swapping the less-than (<) and greater-than (>) symbols in the formulas.
Why is my formula giving an error message?
Check for common syntax errors. Ensure you are using a comma to separate arguments in the AND function and that you haven't accidentally deleted a parenthesis. Also, ensure your version of Excel uses commas; some regional settings (like in Europe) use semicolons (;) instead of commas in formulas.