Data Analytics Roadmap
Excel Basics → Date Functions → DATEDIF Function Complete Masterclass
EXCEL'S SECRET UNDOCUMENTED FORMULA

Master the DATEDIF Function

Calculate exact employee tenure, precise age, project durations, and subscription lifespans in Years ("Y"), Months ("M"), Days ("D"), and remaining months ("YM")!

⏱ ~15 Min Complete Masterclass🕵️ Hidden Excel Function🎮 Live Interactive Tenure Calculator

1. What is the DATEDIF Function & Why is it Special?

The DATEDIF function (Date Difference) calculates the difference between two dates in years, months, or days.

It is famous in Excel history because it is an undocumented legacy function. It does not appear in formula auto-complete suggestions, but it works in every single version of Excel!

Formula Anatomy: The 3 Parameters of DATEDIF()

=DATEDIF( start_date , end_date , unit )
1. START_DATE (REQUIRED)

Earlier Date

Must be earlier than end date (e.g. Birth Date or Hire Date).

A2 = "2020-05-15"
2. END_DATE (REQUIRED)

Later Date

Must be later than start date (e.g. TODAY() or Termination Date).

B2 = "2026-08-12"
3. UNIT CODE (REQUIRED)

Calculation Unit

"Y" (Years), "M" (Months), "D" (Days), "YM" (Remaining Months).

"Y"

2. Real-World Analytics Scenarios for DATEDIF

💼 Scenario A: HR Employee Tenure Tracking

Calculate exact years and months an employee has been with the company.

=DATEDIF(A2, TODAY(), "Y") & " Yrs " & DATEDIF(A2, TODAY(), "YM") & " Mths"

🎂 Scenario B: Exact Customer Age Calculation

Compute exact age in completed years for insurance or banking compliance.

=DATEDIF(A2, TODAY(), "Y")

⌛ Scenario C: Subscription Lifespan (Months)

Calculate total active subscription duration in completed months.

=DATEDIF(A2, B2, "M")

🎮 Live Interactive DATEDIF Tenure Calculator

Pick start date (Cell A2), end date (Cell B2), and calculation unit code!

DATEDIF FORMULA RESULT:6 Full Years
📊 Generated Excel Formula
=DATEDIF(A2, B2, "Y")

🧪 Knowledge Check — DATEDIF Function Quiz

Question 1 of 5Score: 0

🕵️ Why is DATEDIF known as Excel's 'undocumented secret function'?