Sub topic 8
EDATE: moving by whole months
This chapter assumes you can enter formulas, use cell references such as A2, and apply a date format to a cell. It also assumes you know from the earlier chapters that a date is a serial number, so adding 1 moves a date forward one day.
Why adding days is not enough
Adding days moves a date by a fixed number of days. Business rules are rarely written that way. "Renew in three months", "the warranty lasts 12 months" and "the invoice is due one month after the invoice date" all count calendar months, and months have 28 to 31 days. Adding 30 to a date gives the wrong answer for most of them.
You could build the new date with DATE, adding to the month part. That works, but it has an overflow problem, described below. EDATE is designed for this job. It takes a date and a number of months, and returns the date that many months away.
Syntax and return value
=EDATE(start_date, months)start_dateis a date, given as a cell reference, aDATE(...)call, or another formula that returns a date.monthsis the number of months to move. Positive values move forward and negative values move back.- The result is a serial number, not a formatted date.
Because the result is a serial number, a cell formatted as General shows something like 45031 instead of a date. The formula is fine. Apply a date format to the result cell. This is the same format-versus-value distinction from the earlier chapter.
Here are some examples starting from 15 March 2023, which is serial 45000:
=EDATE(DATE(2023,3,15),1)This returns 15 April 2023 (serial 45031).
=EDATE(DATE(2023,3,15),-3)This returns 15 December 2022 (serial 44910). A negative months value moves backward, and the year rolls back without any extra work from you.
=EDATE(DATE(2023,12,15),2)This returns 15 February 2024. The year rolls over automatically.
What EDATE does internally
EDATE works in three steps:
- It reads the year, month and day from the start serial number.
- It adds
monthsto the month number and carries any overflow into the year. - It keeps the original day number and converts the result back to a serial number.
The "day does not exist" branch is covered fully in the next chapter. This chapter only needs the rule that EDATE never returns a date in the wrong month.
EDATE compared with building the date yourself
A common alternative is to add to the month inside DATE:
=DATE(YEAR(A2), MONTH(A2)+1, DAY(A2))When the start date is 31 January 2024, this asks for "31 February 2024". DATE does not reject that. It counts 31 days into February, which has 29 days in 2024, and returns 2 March 2024. The result is in the wrong month.
| Formula | Start date | Result |
|---|---|---|
| `=EDATE(A2,1)` | 31 Jan 2024 | 29 Feb 2024 |
| `=DATE(YEAR(A2),MONTH(A2)+1,DAY(A2))` | 31 Jan 2024 | 2 Mar 2024 |
| `=A2+30` | 31 Jan 2024 | 1 Mar 2024 |
Only EDATE stays in the requested month. The spine example for this behavior is:
=EDATE(DATE(2024,1,31),1)It returns 29 February 2024 (serial 45351). Excel uses the last day of the target month when the same day number does not exist.
Argument rules and edge cases
Whole months only
months is truncated to a whole number, not rounded. =EDATE(A2,1.9) moves forward 1 month. =EDATE(A2,-1.9) moves back 1 month, because truncation goes toward zero. If you need fractional months, EDATE is the wrong tool.
Time of day is dropped
The result is always a whole serial number. If the start value has a time fraction, such as 45000.75 for 6 p.m., the fraction is discarded. If you need to keep the time, add it back separately:
=EDATE(A2,1)+MOD(A2,1)MOD(A2,1) returns the fractional part of the serial number, which is the time of day.
Years are 12 months
There is no separate year argument. Multiply by 12:
=EDATE(A2,12*3)This moves the date forward three years. The same clamping applies. A start date of 29 February 2024 plus 12 months gives 28 February 2025, because 2025 is not a leap year.
Start dates that are not dates
If start_date is text that Excel cannot read as a date, EDATE returns #VALUE!. Text such as "2024-03-15" may be accepted in some regional settings and rejected in others, so do not rely on it. Convert text to real dates first, or build the date with DATE. The last chapter in this series covers text dates in more detail.
A result that falls before serial number 0 returns #NUM!.
Ranges as arguments
Older versions of Excel return #VALUE! if you pass a multi-cell range as start_date. Current Excel with dynamic arrays can spill the result. If you share workbooks with people on older versions, fill the formula down one cell at a time instead.
Patterns that use EDATE
Due dates and renewals
=EDATE(A2,1)This gives a date one month after the invoice date in A2.
End of a term
A 12-month contract that starts on 1 March 2024 ends on 28 February 2025, not 1 March 2025. EDATE gives the first day after the term, so subtract one day:
=EDATE(A2,12)-1This is date arithmetic from the earlier chapter. Subtracting 1 from a serial number moves back one day.
Looking back
Negative months work for look-back windows. To find the date six months before today:
=EDATE(TODAY(),-6)Because TODAY is volatile, this result changes whenever the workbook recalculates.
Payment schedules: count from the original date
A schedule has a trap. Suppose the first payment is on 31 January 2024 and you build each row from the row above:
B2holds the start date, 31 Jan 2024.B3is=EDATE(B2,1), which gives 29 Feb 2024.B4is=EDATE(B3,1), which gives 29 Mar 2024.
The 29th is now fixed for every later payment, even though the intended day was the 31st. Clamping lost information, and the next step cannot recover it.
The safer pattern keeps the original date in one cell and the number of months in another:
=EDATE($A$2, B5)Here $A$2 is the fixed start date and B5 is the month number (0, 1, 2 and so on) for that row. Each row is calculated from the original date, so the day number comes back wherever it exists.
| Payment | Chained from previous row | Counted from original |
|---|---|---|
| 0 | 31 Jan 2024 | 31 Jan 2024 |
| 1 | 29 Feb 2024 | 29 Feb 2024 |
| 2 | 29 Mar 2024 | 31 Mar 2024 |
| 3 | 29 Apr 2024 | 30 Apr 2024 |
Common errors
| Symptom | Likely cause | Fix |
|---|---|---|
| The cell shows `45031` | The result cell is formatted as General | Apply a date format |
| `#VALUE!` | `start_date` is text Excel cannot read, or `months` is non-numeric text | Use `DATE` or convert the text to a real date |
| `#NAME?` | A misspelled function name, such as `EDATES` | Correct the name |
| Date lands on the 29th, 30th or 28th each time | The formula chains from the previous row | Calculate from the original date |
| One day too late at the end of a term | EDATE returns the first day after the term | Subtract 1 |
Exercise
A2 holds 31 March 2024. What does =EDATE(A2,-1) return, and why? Then say what =EDATE(A2,-1) returns if the result cell is formatted as General.
Show answer
It returns 29 February 2024. The day 31 does not exist in February, and 2024 is a leap year, so Excel uses the last day of the month, the 29th. In a General cell it shows the serial number 45351.
Exercise
A software licence starts on the date in A2 and lasts 24 months. Write a formula for the last day the licence is valid. Then explain why =EDATE(A2,24) alone gives the wrong answer for that purpose.
Show answer
=EDATE(A2,24)-1. EDATE(A2,24) returns the same day number two years later, which is the first day after the licence period. Subtracting 1 moves back to the last valid day.
Exercise
Monthly payments start on 30 November 2023. Row 1 holds the start date in B2, and you fill =EDATE(B2,1) down from B3. Why is the schedule wrong from February 2024 onward, and how would you fix it?
Show answer
In February 2024 the 30th does not exist, so EDATE returns 29 February 2024. Each later row then starts from the 29th and never returns to the 30th. Keep the start date in one cell and the month count in another, and use =EDATE($B$2, n) in every row, where n is 0, 1, 2 and so on.