How to Use DATEDIF Function in Excel: HR & Accounting Guide with Examples

DATEDIF in Excel – Calculate Tenure, Loan Age & Employee Experience

DATEDIF Function in Excel – A Powerful Tool for Accountants & HR

Author: Amrut Chitragar

Published on: May 21, 2025

Last Updated: June 27, 2025

🔗 Read more about the author


📌 Disclaimer: This post is for educational purposes only. It does not constitute legal or professional advice. Please consult a tax expert for your specific situation.

📌 TL;DR – Quick Summary

  • DATEDIF calculates years, months, or days between two dates.
  • It’s perfect for HR (experience), Accounts (loan age), or DOB calculations.
  • Syntax: =DATEDIF(start_date, end_date, "unit")
  • Hidden but fully working Excel function – type manually!

📺 Watch: DATEDIF Function in Excel – Explained with Real Formulas!

🎓 Learn how to calculate age, employee experience, and loan tenure using Excel's DATEDIF function with real-life examples and formulas.

The DATEDIF function in Excel is a hidden but powerful tool used to calculate the difference between two dates. Whether you are an Accountant tracking asset age or an HR professional calculating employee tenure, DATEDIF can make your work easier and more accurate.

Syntax:

=DATEDIF(start_date, end_date, unit)

Available Units:

  • "y" – Full years between dates
  • "m" – Full months between dates
  • "d" – Total days between dates
  • "ym" – Remaining months after full years
  • "md" – Remaining days after full months and years
  • "yd" – Days ignoring years (within the same year)

Examples:

Use Case Formula Description
Employee Experience (HR) =DATEDIF(A2, TODAY(), "y") & " Years, " & DATEDIF(A2, TODAY(), "ym") & " Months" Calculates tenure from joining date (A2)
Asset or Loan Age (Accounts) =DATEDIF("01/04/2020", TODAY(), "m") Counts full months since start date
Age Calculation =DATEDIF(B2, TODAY(), "y") Calculates age from date of birth in B2

Why Use DATEDIF?

  • For Accountants: Easily track depreciation, loan terms, or invoice durations.
  • For HR Professionals: Calculate employee tenure, retirement dates, and eligibility for benefits.

Visual Example:

Note: The DATEDIF function isn’t listed in Excel’s function suggestions, but it works perfectly when typed manually.

More FAQs Based on Popular Google Searches

Is DATEDIF available in Excel 365 and Excel 2021?
Yes, it works fine even though it doesn’t auto-suggest in the formula bar.

How do I fix DATEDIF errors like #NUM! or #VALUE?
Ensure your start date is earlier than the end date and that the unit is inside double quotes.

What’s the difference between DATEDIF and YEARFRAC?
DATEDIF gives full periods (years, months, days), while YEARFRAC returns a decimal value (like 1.75 years).

🔔 Stay Connected with Us!

Follow us for more practical finance & Excel tutorials:

Post a Comment

Previous Post Next Post