Months of service with DATEDIF
PremiumIn C2, use DATEDIF to count the whole months of service from the hire date in A2 to the date in B2.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Hired | Date | Months | |||
| 2 | Nov 1, 2019 | Mar 15, 2024 | ||||
| 3 | ||||||
| 4 | ||||||
| 5 | ||||||
| 6 | ||||||
| 7 | ||||||
| 8 |
Premium lesson
Unlock DATEDIF and every other lesson
This is a premium lesson. Premium lets you solve it and every other lesson, take the timed mock tests, and earn certificates you can share on LinkedIn.
Next with premium:Week numbers and weekendsLoans: PMT and NPER
Need help?
Why this works
From Nov 1, 2019 to Mar 15, 2024 is 4 years, 4 months and 14 days. DATEDIF with "m" counts only the complete months, 4 × 12 + 4 = 52. "ym" gives the months left over after the whole years, 4.
Common mistake: Using "y" and multiplying by 12. That drops the 4 months after the last full year.
The answer
- C2
=DATEDIF(1A2,2B2,3"m")
In plain words: Count the 3whole months from 1the hire date in A2 to 2the date in B2.