Conditional Formatting with EDATE: Excel Date Rules

Formulas & functions · Updated November 22, 2026

Yes, you can use EDATE inside conditional formatting to highlight cells based on a date that is a certain number of months away from another date. The simplest approach is to create a formula rule like =A2=EDATE(TODAY(),3) to highlight dates exactly three months from today, or =A2<EDATE(TODAY(),-6) to flag dates older than six months. This works in Excel for Microsoft 365, Excel 2021, and earlier versions that support EDATE (which is most versions from Excel 2007 onward).

What EDATE Does and Why It Matters for Formatting

EDATE is a date function that returns a date a specified number of months before or after a given start date. Its syntax is EDATE(start_date, months). For example, EDATE(DATE(2025,1,15), 2) returns March 15, 2025. The key advantage is that it handles month-end correctly: EDATE(DATE(2025,1,31), 1) returns February 28, 2025 (or February 29 in a leap year), not March 3. This makes it ideal for recurring deadlines, subscription renewals, or review schedules.

In conditional formatting, you are not limited to comparing against TODAY(). You can reference any cell containing a date, such as a project start date or a contract signing date. This allows you to build rules that highlight rows or cells based on relative months from a variable reference point.

How to Create a Conditional Formatting Rule with EDATE

Here are the exact steps for Excel for Microsoft 365 on Windows. On Mac, the steps are identical except the dialog appears as a sheet rather than a floating window.

  1. Select the range of cells that contain the dates you want to format (e.g., A2:A100).
  2. Go to Home > Conditional Formatting > New Rule.
  3. Choose Use a formula to determine which cells to format.
  4. In the formula box, enter a formula that references the top-left cell of your selection. For example, if your selection starts at A2, enter =A2=EDATE(TODAY(),3).
  5. Click Format, choose a fill color or font style, then click OK.
  6. Click OK again to apply the rule.

Important: The formula must be relative to the active cell in the selection. If you select A2:A100, the active cell is typically A2. If you select a range where the active cell is not the top-left (e.g., you clicked B5 first then extended the selection), adjust the formula accordingly.

Common Use Cases and Example Formulas

Here are practical scenarios with formulas assuming your date column starts at A2:

  • Highlight dates exactly 3 months from today: =A2=EDATE(TODAY(),3)
  • Highlight dates within the next 6 months (including today): =AND(A2>=TODAY(), A2<=EDATE(TODAY(),6))
  • Highlight dates older than 12 months from today: =A2<EDATE(TODAY(),-12)
  • Highlight dates that are exactly 1 month after a start date in column B: =A2=EDATE($B2,1) (use absolute column reference if needed)
  • Highlight entire row when a date in column A is past due by more than 2 months: Select the whole range A2:C100, then use =$A2<EDATE(TODAY(),-2) and apply formatting to the row.

For the row highlighting example, note the dollar sign before the column letter ($A2) locks the column but allows the row to change as the rule applies to each row.

How to Choose Between EDATE and Other Date Functions

EDATE is not always the best tool. Consider these alternatives:

  • EDATE – Use when you need to add or subtract whole months and want month-end handling. Best for subscription periods, payment schedules, or contract renewals.
  • DATE(YEAR(A2), MONTH(A2)+n, DAY(A2)) – This gives the same result as EDATE for most dates, but it fails for month-end dates (e.g., Jan 31 + 1 month returns March 3, not Feb 28). Use EDATE to avoid that pitfall.
  • DATEDIF – Use when you need to calculate the number of months between two dates, not to create a new date. For conditional formatting, you might write =DATEDIF(TODAY(),A2,"m")>=3 to highlight dates at least 3 months in the future, but this does not handle partial months the same way.
  • EOMONTH – Use when you need the last day of a month, e.g., =A2=EOMONTH(TODAY(),0) highlights dates that are the last day of the current month.

For most “months from a date” rules, EDATE is the simplest and most reliable.

Common Problems and How to Fix Them

Several issues frequently trip up users:

  • Rule doesn’t highlight anything – Check that your dates are real Excel dates (numbers), not text. Use =ISNUMBER(A2) to test. If they are text, convert them using DATEVALUE or Text to Columns.
  • Wrong rows get highlighted – The formula must match the active cell. If you select A2:A100 but the active cell is A5, your formula should reference A5, not A2. You can see the active cell in the Name Box.
  • EDATE returns a serial number, not a date – That’s normal; Excel stores dates as numbers. The conditional formatting comparison works fine. If you see a number in a cell, change the cell format to Date.
  • Rule works in one cell but not others – Check for absolute vs relative references. If you used $A$2 instead of A2, every cell will compare to A2, which is rarely what you want.
  • Conditional formatting with EDATE in Google Sheets – Google Sheets has EDATE too, but the menu path is Format > Conditional formatting, and you use a custom formula with the same syntax. The main difference is that Google Sheets uses semicolons as argument separators in some locales, but in the US locale commas work.

Performance and Maintenance Tips

Conditional formatting rules with EDATE are recalculated whenever the workbook recalculates. If you have thousands of rows, this can slow things down slightly, but it’s usually negligible. To keep things manageable:

  • Use a single rule for a range rather than multiple overlapping rules.
  • Avoid volatile functions like TODAY() if your data is static and you don’t need it to update daily – but if you do need daily updates, TODAY() is fine.
  • If you copy a range with conditional formatting, the rules copy along. Use Paste Special > Formats to copy only the rule.
  • To remove a rule, go to Home > Conditional Formatting > Manage Rules and delete it.

Remember that conditional formatting is visual only; it does not change the underlying data. If you need to filter or sort based on the same condition, consider adding a helper column with the EDATE formula and then filter on that.

Frequently Asked Questions

Can I use EDATE with a cell reference as the start date?

Yes. For example, if you have a start date in B2, you can write =A2=EDATE($B$2,6) to highlight dates in column A that are exactly 6 months after that specific start date. Use absolute references if you want all rows to compare to the same cell, or relative references if each row has its own start date.

Does EDATE work with dates before 1900?

No. Excel’s date system starts at January 1, 1900 (or January 1, 1904 on Mac with the 1904 date system). EDATE will return a #NUM! error if the start date is before that. For historical dates, you would need to handle them as text or use a different approach.

Why does my conditional formatting stop working after I sort the data?

Conditional formatting rules are tied to the range, not the individual cells. When you sort, the formatting moves with the cells, but if you have a formula that references a specific cell like TODAY(), it still works. The issue is usually that you applied the rule to a range that doesn’t cover the new rows, or you used a formula that references the wrong relative cell after sorting. Re-apply the rule to the full range.

Can I use EDATE in a color scale or data bar?

No. Color scales and data bars require numeric values, and EDATE returns a date serial number, which is numeric but not useful for a gradient. For color scales, you would need to use a formula that returns a number like the number of months difference, e.g., =DATEDIF(TODAY(),A2,"m"), but that is not a direct EDATE use.

Is there a way to highlight weekends or weekdays using EDATE?

EDATE doesn’t help with weekdays. Use the WEEKDAY function instead, e.g., =WEEKDAY(A2,2)>5 to highlight Saturdays and Sundays. EDATE is specifically for month arithmetic.

What if I need to highlight dates that are between 3 and 6 months from today?

Use a formula like =AND(A2>=EDATE(TODAY(),3), A2<=EDATE(TODAY(),6)). This highlights dates that fall in that window, inclusive of the exact 3-month and 6-month dates.

Related

Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.

More in Formulas & functions

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.