Count the months between two dates — whole months for tenure or subscription length, or a fractional figure for prorating. DATEDIF and a little arithmetic each have their place.
(B2-B1)/30.44 (avg month length).
The example
Months between two dates.
| A | B | |
|---|---|---|
| 1 | Span | Months |
| 2 | Jan 15 → Jun 17 | 5 |
The formula
Whole months elapsed:
How it works
Choose whole or fractional months:
- Whole months:
DATEDIF(start, end, "m")counts complete months, ignoring leftover days. - Months + days: add
DATEDIF(…, "md")for the remaining days. - Calendar-month difference (ignoring the day):
(YEAR(B2)-YEAR(B1))*12 + MONTH(B2)-MONTH(B1). - Approx decimal:
(B2-B1)/30.44for prorating — not exact, but fine for estimates.
Billing-month count often wants the calendar-month formula (the (YEAR…)*12+… version), which counts month boundaries crossed regardless of the day — e.g. Jan 31 to Feb 1 is “1 month” for billing even though DATEDIF’s "m" returns 0.
Try it: interactive demo
Two dates → months between.
Variations
Months + days
Add the remainder:
Calendar months
Boundaries crossed:
Approx decimal
For prorating:
Pitfalls & errors
"m" is whole months. Jan 31 to Feb 28 is 0 complete months by DATEDIF, which can surprise — use the calendar-month formula for billing.
Order matters. Start before end, or DATEDIF returns #NUM!.
Decimal is approximate. 30.44 is an average; for exact prorating use day counts within each month.
Practice workbook
Frequently asked questions
How do I count months between two dates in Excel?
How do I get months and leftover days?
Why does DATEDIF return one fewer month than I expect?
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