• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

How To Use: DATEDIF Function

How To Use: DATEDIF Function

DATEDIF Function calculates the number of days, months, or years between two dates. The DATEDIF function is provided in order to support older workbooks from Lotus 1-2-3. It may calculate incorrect results under certain scenarios.

In simple terms, the DATEDIF function returns the difference between two date values for a specified interval.

DATEDIF is an inbuilt function in Excel. It is under the category of Date and Time Functions. The DATEDIF is one of the very few undocumented functions of Excel. Being undocumented means, you cannot find it in the formula list.

As a worksheet function, you can enter the DATEDIF Function as a part of a formula in a cell of a worksheet.

This function can be used when we want to calculate the number of years, months, or days between the two dates. A perfect example of it is calculating the age.

Syntax for DATEDIF Function

DATEDIF(start_date,end_date,unit)

Arguments

Start_Date: A date that represents the first, or starting, date of the period. Dates can be entered as text strings within quotation marks or as serial numbers or as the results of other formulas or functions.

End_Date: A date that represents the last, or ending, date of the period.

Units: The type of information that you want returned. Units can be any of the following:

Y = Difference in complete years
M = Difference in complete months
D = Difference in days
MD = Difference in days, ignoring months and years
YM = Difference in months, ignoring days and years
YD = Difference in days, ignoring years.

We have created the infographics for the DATEDIF Function. With the help of these infographics, you can easily learn step by step process for using this excel functions.

Furthermore, Excel consists of many inbuilt functions which are helpful in the analytical and statistical study of number.

Simply follow the instructions in the infographics below:

DATEDIF Function

Errors

#VALUE! error occurs when the supplied arguments are non numeric.

#NUM! error occurs when units are numneric and other than the accepted alphabatical criteia.

To learn other function like MID, QUOTIENT and KURT Functions, please click on the name of the function.

Additionally, you can download other accounting templates like Break Even Analysis Template, Salary Sheet Template and Invoice with GST Template from here.

We thank our readers for liking, sharing and following us on different social media platforms.

If you have any queries please share in the comment section below. I will be more than happy to assist you.

Filed Under: Basic Excel Functions

You are Here: Home / Basic Excel Functions / How To Use: DATEDIF Function

About Shabbir Bhimani

I have worked in Excel and like to share functional excel templates at ExcelDataPro.

ExcelDataPro

Free Excel Pro Templates

  • Glossary
    • Accounting Glossary
    • HR & Payroll Glossary
    • Tax Glossary
  • Templates
    • Accounting
      • Financial Analysis
      • Financial Statement
    • Educational
    • Taxation
      • Federal Income Tax
      • GST
      • UAE VAT
      • UK VAT
    • Human Resources
      • HR & Payroll
      • HR Metrics
    • School Management
    • Social Media
    • Sales-Marketing
    • Personal Finance
    • Other
      • Health & Fitness
  • Functions
  • Calculators
  • Home
  • Contact
  • Privacy
  • Terms

© ExcelDataPro 2025. Content Licensed Under Creative Commons with Attribution Required

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Cookie settingsACCEPT
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT