Sub topic 8
EDATE: moving by whole months
This chapter assumes you can enter formulas, use cell references such as A2, and apply a number format. It also assumes you know that Excel stores a date as a serial number, a count of days. Dates in this chapter use the 1900 date system.
Why adding days is not enough
Adding 30 to a date moves it 30 days. Months have different lengths, so that is not the same as moving one month. Starting from 15 January, +30 lands on 14 February. You usually want 15 February.
EDATE solves this. It moves a date forward or backward by a whole number of months and keeps the day of the month where it can.
Syntax
=EDATE(start_date, months)start_dateis a date. Use a cell reference or theDATEfunction.monthsis the number of months to move. A positive number moves forward. A negative number moves back. A decimal is cut to a whole number, so 1.9 acts as 1.
EDATE returns a serial number. If the cell shows a number such as 45351, apply a date format to see the date. Switching the cell to General shows the serial number again.
A worked example
Suppose A2 holds 15 March 2024. Then:
=EDATE(A2,1)This returns 15 April 2024. Using -2 returns 15 January 2024. Using 12 returns 15 March 2025.
A common use is a monthly schedule. Put the first due date in A2, then fill this formula down from A3:
=EDATE(A2,1)Each row is one month after the row above it.
Month-end clamping
Some months do not have the day you started on. 31 January plus one month would be 31 February, which does not exist. EDATE does not return an error here. It clamps the result to the last day of the target month.
=EDATE(DATE(2024,1,31),1)This returns 29 February 2024, serial 45351. The year 2024 is a leap year. In 2023 the same formula would return 28 February.
Clamping does not undo itself
Clamping loses the original day. Moving forward and then back does not always return the start date.
=EDATE(EDATE(DATE(2024,1,31),1),-1)The inner EDATE gives 29 February. Moving back one month then gives 29 January, not 31 January.
This matters in a long schedule. If you chain each row from the row above, the day stays low once it has been clamped. A row that starts on the 31st will drift to the 29th, then stay there. To avoid this, always calculate from the original start date and increase the month count:
=EDATE($A$2,ROW()-ROW($A$2))Here A2 is the first date. Row 3 moves 1 month, row 4 moves 2 months, and so on. Each result is clamped on its own, so March returns to 31 March.
Common errors
| Symptom | Likely cause | Fix |
|---|---|---|
| Result shows a number such as 45351 | The cell is formatted as General | Apply a date format |
| `#VALUE!` | `start_date` is text, not a real date | Rebuild it with `DATE`, or convert the text |
| Day of month slowly drifts | Each row builds on the clamped row above | Use the original start date and a growing month count |
| Result is one month off from what you expect | `months` was a decimal and was truncated | Use whole numbers |
Check your understanding
Exercise
A2 holds 30 November 2023. What does =EDATE(A2,3) return, and why?
Show answer
It returns 29 February 2024. Three months after November is February. February 2024 has no 30th, so EDATE clamps to the last day of the month, which is 29 because 2024 is a leap year.
Exercise
A2 holds 31 March 2024. You fill =EDATE(A2,1) down A3:A5, with each row referring to the row above. What are the dates in A3 to A5? Then write a formula for A5 that gives the better result.
Show answer
A3 is 30 April 2024, A4 is 30 May 2024, and A5 is 30 June 2024. The day stays at 30 after the first clamp. A better formula for A5 is =EDATE($A$2,3), which returns 30 June 2024 here, and gives 31 July when the count is 4. Each result is calculated from the original date, so the day is not lost.