Excel Date Difference Calculator

Calculate the difference between two dates in years, months, weeks, and days. A free replacement for Excel's DATEDIF function — useful for age calculation, project duration, service length, and any date-based analysis.

Total Days
2,495
Years
6
Months
82
Weeks
356.43
Years + Months + Days
6y 10m 0d
Working Days (approx)
1,783
Weekend Days
712
Hours
59,880

What Is a Date Difference?

A date difference is the amount of time between two dates, expressed in days, weeks, months, or years. It is one of the most common calculations in spreadsheets — used for employee service length, project duration, invoice aging, age calculation, and countless other purposes.

Excel has a built-in function called DATEDIF that calculates the difference between two dates in various units. This tool provides the same functionality in your browser, without needing Excel — useful for quick checks, cross-verification, or situations where you do not have Excel open.

How Date Difference Is Calculated

Total Days — the simplest calculation. Subtract the earlier date from the later date. Excel stores dates as serial numbers (1 = January 1, 1900), so subtraction gives the number of days between them.

Years, Months, Weeks — derived from total days:

Years + Months + Days (YMD) — the most precise breakdown. It counts the complete years first, then the complete months in the remaining period, then the remaining days. This is what Excel's DATEDIF function returns with unit "Y", "YM", and "MD" combined.

Working Days — weekdays (Monday–Friday) only, excluding weekends. This is approximate because it does not exclude public holidays. Use the Working Days Calculator for holiday exclusion.

Excel DATEDIF Function

Excel's DATEDIF function has this syntax:

=DATEDIF(start_date, end_date, unit)

The unit argument can be:

DATEDIF is a "hidden" Excel function — it does not appear in the function autocomplete, but it works if you type it manually. This tool replicates its main outputs without needing Excel.

Worked Example

Start date: January 1, 2020
End date: November 1, 2026

Total days = 2,495
Years = 2,495 ÷ 365.25 ≈ 6.83 → 6 complete years
Months = 82 complete months
Weeks = 2,495 ÷ 7 ≈ 356.43
YMD breakdown = 6 years, 10 months, 0 days
Working days ≈ 1,783 (excluding weekends)
Weekend days ≈ 712
Hours = 2,495 × 24 = 59,880

Frequently Asked Questions

What is the difference between days and YMD?

"Total days" is a single number — the actual count of days between the two dates. "YMD" breaks the same period into complete years, complete months, and remaining days. For example, 2,495 days might be "6 years, 10 months, 0 days". YMD is more meaningful for human understanding; total days is easier for calculations.

Does this include the start date and end date?

The calculator counts days between the two dates, excluding the start date. So January 1 to January 2 is "1 day". If you need to include both the start and end (i.e., count both endpoints), add 1 to the total days. Standard convention varies — Excel's DATEDIF excludes the start date (it counts from the day after start to the end date), and this calculator follows that convention.

How is "working days" calculated?

The working days figure counts Monday through Friday only, excluding weekends. It does not exclude public holidays — so the actual working days may be lower if there are holidays in the period. For precise working days with holidays excluded, use the Working Days Calculator which allows you to enter specific holiday dates.

Can I calculate age from a birth date?

Yes — enter the birth date as the start date and today's date as the end date. The "Years" output gives the person's age in complete years. The "YMD" output gives the exact age in years, months, and days. For example, someone born on January 15, 1990 and today is November 1, 2026 would be 36 years, 9 months, 17 days old.

How does Excel handle leap years?

Excel handles leap years automatically because it stores dates as serial numbers — the leap day is just one more day in the count. This calculator follows the same logic. The "years" output uses 365.25 days per year (the average accounting for leap years), which gives slightly different results from dividing by 365. The YMD breakdown correctly handles leap years because it is based on actual calendar dates, not day counts.

Why does my Excel DATEDIF give a different result?

There are several reasons. First, DATEDIF has documented bugs with certain date combinations (particularly with end-of-month dates and February). Second, this calculator uses average days (365.25) for the "years" output, while DATEDIF uses calendar years. Third, Excel's DATEDIF behaves differently depending on whether you use "Y" (complete years) or "YD" (days ignoring years). For most practical purposes, the results will match — if there is a small discrepancy, use the YMD breakdown as the most accurate measure. Both tools use the same underlying logic.

Related Tools