Sub topic 9
Moving by months with EDATE and EOMONTH
This chapter assumes you can enter formulas, use relative and absolute references, and apply number formats from the Format menu. It also assumes you know that Sheets stores a date as a number of days. Earlier chapters covered that, along with DATE, YEAR and MONTH.
Why adding 30 days is not adding a month
Months have 28, 29, 30 or 31 days. If you add 30 to a date, you land on a different day of the month depending on where you started. Billing dates, lease renewals, subscription cycles and reporting periods all work in calendar months, so you need functions that count months and not days.
Sheets has two for this:
EDATE(start_date, months)returns the date that is a given number of months before or after a start date, keeping the same day of the month where possible.EOMONTH(start_date, months)returns the last day of the month that is a given number of months before or after a start date.
Both return a serial number. Format the cell as a date to read it. In a cell with automatic formatting, Sheets usually applies a date format for you. If you see a number such as 46081, change the format to a date (Format > Number > Date).
EDATE: same day, different month
The syntax is EDATE(start_date, months). The months argument is a whole number. Positive values move forward and negative values move back. Zero returns the start date.
=EDATE(DATE(2026, 11, 28), 3)This returns 2027-02-28. Three months after 28 November 2026 is 28 February 2027.
What happens when the target month is shorter
If the start day does not exist in the target month, EDATE returns the last day of that month. It never spills into the next month.
=EDATE(DATE(2026, 1, 31), 1)This returns 2026-02-28, because 2026 is not a leap year and February has 28 days.
| Start date | Months | Result | Reason |
|---|---|---|---|
| 2026-01-31 | 1 | 2026-02-28 | February has no 31st, so the last day is used |
| 2028-01-31 | 1 | 2028-02-29 | 2028 is a leap year |
| 2026-03-31 | -1 | 2026-02-28 | Moving backward follows the same rule |
| 2026-05-31 | 1 | 2026-06-30 | June has 30 days |
| 2026-11-28 | 3 | 2027-02-28 | The day exists, so it is kept |
Fractional months are truncated
If you pass a non-integer, Sheets drops the fractional part. EDATE(A2, 2.9) moves two months, not three. Do not rely on this. If the month count comes from a calculation, wrap it in INT or ROUND so your intent is visible.
The month-end drift trap
EDATE does not remember where you started. If you chain it, the clamped day sticks:
=EDATE(EDATE(DATE(2026, 1, 31), 1), 1)The inner call returns 2026-02-28. The outer call moves that to 2026-03-28, not 2026-03-31. To build a schedule, always offset from the original date:
=EDATE($A$2, ROW() - ROW($A$2))Here $A$2 holds the first date. Row 2 gets an offset of 0, row 3 gets 1, and so on. Every row counts from the same anchor, so a 31 January start gives 28 February, 31 March, 30 April and so on.
EOMONTH: the last day of a month
The syntax is EOMONTH(start_date, months). It first moves by months, then returns the final day of the month it reaches.
=EOMONTH(TODAY(), 0)With 0 months, this returns the last day of the current month. With 1 it returns the last day of next month, and with -1 the last day of last month.
Because EOMONTH always lands on the last day, you never need to know whether the month has 28, 29, 30 or 31 days. That makes it the safe building block for month-end reports.
| Formula | Result when A2 is 2026-11-28 |
|---|---|
| `=EOMONTH(A2, 0)` | 2026-11-30 |
| `=EOMONTH(A2, 1)` | 2026-12-31 |
| `=EOMONTH(A2, 3)` | 2027-02-28 |
| `=EOMONTH(A2, -1)` | 2026-10-31 |
| `=EOMONTH(A2, -12)` | 2025-11-30 |
Useful patterns built from EOMONTH
Because EOMONTH is reliable at month boundaries, you can derive several other dates from it.
First day of a month
The last day of the previous month, plus one day, is the first day of the current month:
=EOMONTH(A2, -1) + 1This is equivalent to DATE(YEAR(A2), MONTH(A2), 1). Use whichever reads better to you. The EOMONTH form is shorter when you also need the first day of other months, for example =EOMONTH(A2, 0) + 1 for the first day of next month.
Days in a month
=DAY(EOMONTH(A2, 0))The last day's day number is the number of days in the month. This handles leap years without any special rule.
Days remaining in the month
=EOMONTH(A2, 0) - A2This is ordinary date subtraction: the result is a count of days, not a date, so format the cell as a number.
Filtering rows to one month
To test whether a date in A2 falls in the same month as a date in D1, without comparing year and month separately:
=EOMONTH(A2, 0) = EOMONTH($D$1, 0)This returns TRUE when both dates share a month and year. It is safer than MONTH(A2) = MONTH($D$1), which also matches the same month in other years.
Grouping dates by month
If you build a summary table, use the month end as the key. Put this in a helper column:
=EOMONTH(A2, 0)Every date in November 2026 now maps to the same value, 2026-11-30, so SUMIF or COUNTIF can group on that column.
Applying them to whole columns
Both functions accept a range inside ARRAYFORMULA. The pattern below fills a month-end column from every filled row of column A and leaves blank rows empty:
=ARRAYFORMULA(IF(A2:A="", "", EOMONTH(A2:A, 0)))The IF guard matters. Without it, an empty cell is read as day 0, which is 1899-12-30, and EOMONTH returns 1899-12-31 for every blank row.
Worked example: a payment schedule
Suppose a loan of 12 monthly payments starts on 2026-01-31 and each payment is due on the same day of the month where possible. Put the start date in B1 and number the payments 1 to 12 in A4:A15.
=EDATE($B$1, A4)Fill this down from B4. The results are 2026-02-28, 2026-03-31, 2026-04-30, 2026-05-31, and so on. Each row is calculated from $B$1, so the schedule does not drift.
If instead each payment is due on the last day of the month, use:
=EOMONTH($B$1, A4)For a start of 2026-01-31 this gives the same dates in this case. The two differ when the start date is not a month end. A start of 2026-01-15 gives 15 February with EDATE and 28 February with EOMONTH.
Common errors
- A number such as 46081 appears. The result is correct but the cell has a number format. Apply a date format.
#VALUE!error. The start date is text, not a real date. Convert it withDATEVALUEor rebuild it withDATE. A quick check is=ISNUMBER(A2), which returns FALSE for text.- A date one month off. You probably chained EDATE calls, or you expected EDATE to return a month end. Use EOMONTH if you want month ends.
- 1899 dates in blank rows. A blank cell counts as 0. Guard with
IF(A2="", "", ...). - Time of day is lost. Both functions return a whole date. If the start has a time part, the time is dropped. Add it back with
+ MOD(A2, 1)if you need it.
Choosing between them
| You need | Use |
|---|---|
| Same day number next month, such as a monthly anniversary | `EDATE` |
| The last day of a month, such as a month-end close | `EOMONTH` |
| The first day of a month | `EOMONTH(date, -1) + 1` |
| A date one year later | `EDATE(date, 12)` |
| A key for grouping by month | `EOMONTH(date, 0)` |
Exercise
Cell A2 holds 2026-12-31. What do =EDATE(A2, 2) and =EOMONTH(A2, 2) return, and what does =EOMONTH(A2, -1) + 1 return?
Show answer
=EDATE(A2, 2) returns 2027-02-28, because February 2027 has no 31st and EDATE uses the last valid day. =EOMONTH(A2, 2) returns 2027-02-28 as well, because it returns the last day of the month two months later. =EOMONTH(A2, -1) + 1 returns 2026-12-01: the last day of November is 2026-11-30, and adding 1 gives the first day of December.
Exercise
Write a formula that returns the number of days left in the month of the date in A2, counting A2 itself as a remaining day. Then explain why =EDATE(EDATE(DATE(2026, 1, 31), 1), 1) does not return 2026-03-31.
Show answer
Use =EOMONTH(A2, 0) - A2 + 1. Without the + 1, the formula counts only the days after A2. The chained formula returns 2026-03-28. The inner EDATE clamps 31 January to 28 February, and the outer EDATE then adds one month to 28 February, which gives 28 March. EDATE keeps no memory of the original day. To get 31 March, compute =EDATE(DATE(2026, 1, 31), 2) from the original date.
Exercise
A column A holds invoice dates from row 2 down, with some blank rows. Write one formula for B2 that fills B with each invoice's due date, which is the last day of the following month, and leaves blank rows empty.
Show answer
=ARRAYFORMULA(IF(A2:A="", "", EOMONTH(A2:A, 1))). The 1 moves to the next month and EOMONTH returns its last day. The IF test stops blank rows from returning 1899-12-31.