Compare this period to the same one a year ago. EDATE shifts a date by whole months — -12 for one year back — handling month lengths and leap years cleanly.
The example
One year before June 17, 2026.
| A | B | |
|---|---|---|
| 1 | This year | Last year |
| 2 | 6/17/2026 | 6/17/2025 |
The formula
Shift back twelve months:
How it works
EDATE shifts by months, not days:
EDATE(date, months)moves the date by a whole number of months —-12= one year back,-1= previous month.- It keeps the same day when possible, and clamps to month-end when the target month is shorter (e.g. Jan 31 → Feb 28).
- Subtracting 365 days is wrong across leap years; EDATE handles them correctly.
- Pair it with SUMIFS to total the same period last year for a YoY comparison.
Year-over-year totals: =SUMIFS(sales, dates, ">="&EDATE(start,-12), dates, "<="&EDATE(end,-12)) sums the matching window a year ago — the backbone of a YoY growth calc.
Try it: interactive demo
Pick a date and a month shift.
Variations
Previous month
One month back:
YoY total
Same window last year:
YoY growth %
Compare the two:
Pitfalls & errors
Don’t subtract 365. Leap years make a fixed day count drift; EDATE keeps the calendar date correct.
Month-end clamping. Mar 31 minus a month is Feb 28/29 — EDATE clamps, which is usually what you want but worth knowing.
Format as a date. EDATE returns a serial number.
Practice workbook
Frequently asked questions
How do I get the same date last year in Excel?
How do I total the same period last year?
Why not just subtract 365 days?
Stop fighting formulas. Learn them in a day.
This recipe is one of hundreds of real-world formulas we teach. Our Excel Formulas & Functions class covers lookups, logic, text, and dynamic arrays hands-on — live in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.
See the Formulas & Functions Class