In this Article, I am going to explain you, how can you use DATEDIF() Function and also using this, how can you calculate Age in Excel.

Basically DATEDIF calculates difference between two dates. The most interesting part of this Function is that you can calculate the difference between two dates by a given intervals. If i say Intervals, what does it mean? Interval means, In what interval do you actually want the difference between two dates like total difference in Months, or Years or Days etc.
 
Syntax for the DATEDIF() Function:

=DATEDIF(StartDate, EndDate, Interval)
 
Where:
StartDate: is the First Date
EndDate: is the Second Date
Interval: This is the format or Type in which the difference you want
 

Note:

First Date should not be later than Second Date. If First Date is later than Second Date then the Formula will return an Error.
 
For Interval, we have few predefined Syntax, which you can use any one of them. Below is the list and Description for each of the Intervals
 

IntervalMeaningDescription
dDayReturns Total Number of Days between Two Dates
mMonthReturns Total Number of Months between Two Dates
yyearReturns Total Number of Years between Two Dates
ydDays Excluding YearsTotal Number of Days considering they are from the Same year.
ymMonths Excluding YearsTotal Number of Months considering they are from the Same year.
mdNumber of Days Excluding Years and MonthTotal Number of Days considering they are from the Same Months and Same year.

 

Note:

1. If you are giving Dates and Interval Directly in your Formula then they both must be passed in DOUBLE QUOTES (“”) otherwise you can pass the reference directly.
 
=DATEDIF(StartDate,EndDate,”m”)

How to Calculate Age using this Function:

Using this Function we can calculate Age of Some One just by Passing his/her Birth date. In A1 Cell the Date of Birth is Kept. Considering that you can use the following Formula.
 
=DATEDIF(A1,TODAY(),”y”)&” Years “&DATEDIF(A1,TODAY(),”ym”)&” Months and “&DATEDIF(A1,TODAY(),”md”)&” Days”

 

cover3d_0-89071700_1484285537__1_

Join over 10, 000+ Excel VBA Enthusiasts & get this FREE e-Book Now!