Excel DatedIF Function

This post will guide you how to use Excel DATEDIF function with syntax and examples in Microsoft excel.

Description

The Excel DATEDIF function returns the number of days, months, or years between tow dates.

The DATEDIF function is a build-in function in Microsoft Excel and it is categorized as a DATE and TIME Function.

The DATEDIF function is available in Excel 2016, Excel 2013, Excel 2010, Excel 2007, Excel 2003, Excel XP, Excel 2000, Excel 2011 for Mac.

Syntax

The syntax of the DATEDIF function is as below:

=DATEDIF (start_date,end_date,unit)

Where the DATEDIF function arguments are:
Unit –  the type of information that you want to return.
Note: The index_num value must be a number between 1 and 29.

  • “Y”– The number of complete years
  • “M”– The number of complete months
  • “D”– The number of days
  • “MD”– The difference between the days in start_date and end_date.
  • “YM”– The difference between the months in start_date and end_date
  • “YD”– The difference between the days(the years of dates are ignored)

Example

The below examples will show you how to use Excel DATEDIF Function to return the difference between two dates.

#1 =DATEDIF(B1,B2,”Y”)
excel datedif function example1

Note: the above excel formula will return the number of complete year as “1”between start_date(6/1/2016) and end_date(07/2/2017).

#2 =DATEDIF(B1,B2,”D”)
excel datedif function example2

Note: the above formula will return the number of days(396) between 6/1/2016 and 7/2/2017.

#3 =DATEDIF(B1,B2,”YD”)
excel datedif function example3
Note: the above formula will return 31 days between 6/1 and 7/2, ignoring the years of dates.

x
How to Highlight Every Other Row Using Conditional Formatting in Excel
 

Related Posts

Excel DVARP Function
excel dvarp examples1

This post will guide you how to use Excel DVARP function with syntax and examples in Microsoft excel. Description The Excel DVARP Function will get the variance of a population based on the entire population of numbers in a column ...

Excel DVAR Function
excel dvar examples1

This post will guide you how to use Excel DVAR function with syntax and examples in Microsoft excel. Description The Excel DVAR Function will get the variance of a population based on a sample of numbers in a column in ...

Excel DSUM Function
excel dsum examples1

This post will guide you how to use Excel DSUM function with syntax and examples in Microsoft excel. Description The Excel DSUM Function will add the numbers in a column or database that meets a given criteria. And so you ...

Excel DSTDEVP Function
excel dstdevp examples1

This post will guide you how to use Excel DSTDEVP function with syntax and examples in Microsoft excel. Description The Excel DSTDEVP returns the standard deviation of a population based on the entire population of numbers in a column or ...

Excel DSTDEV Function
excel dstdev examples1

This post will guide you how to use Excel DSTDEV function with syntax and examples in Microsoft excel. Description The Excel DSTDEV returns the standard deviation of a population based on a sample of numbers in a column or database ...

Excel DMIN Function
excel dmin function example1

This post will guide you how to use Excel DMIN function with syntax and examples in Microsoft excel. Description The Excel DMIN returns the minimum value from a database or a column of a list that matches the specified conditions. ...

Excel DPRODUCT Function
excel dproduct examples1

This post will guide you how to use Excel DPRODUCT function with syntax and examples in Microsoft excel. Description The Excel DPRODUCT returns the product of values from a set of records that match criteria that you specify. The DPRODUCT ...

Excel XIRR Function
excel xirr examples1

This post will guide you how to use Excel XIRR function with syntax and examples in Microsoft excel. Description The Excel XIRR function returns the internal rate of return for a series of cash flows that is not necessarily periodic. ...

Excel VDB Function
excel vdb examples1

This post will guide you how to use Excel VDB function with syntax and examples in Microsoft excel. Description The Excel VDB function calculates the depreciation of an asset for a specified period based on the double declining balance method. ...

Excel SYD Function
excel syd examples1

This post will guide you how to use Excel SYD function with syntax and examples in Microsoft excel. Description The Excel SYD function calculates the sum-of-years’digits depreciation of an asset for a specified period. And it will return a numeric ...

Sidebar