Somethings just stay evergreen, just like the DATEDIF function! Back in day (days of Excel 2003) it used to be a stud amongst the Date Functions and it has not lost its sheen till date but the newer versions of excel (2007 and above) have stopped giving any help or guidance with this function
Here is =DATEDIF for you
What it does: It returns the difference between two date values in either days, months, years or some other mixed formats. Since there is no screen guidance available when you type =DATEDIF you’d have to learn the syntax. It is very simple 🙂
Let’s say we have two dates to begin with
--> will return the number of days between the 2 dates
=DATEDIF(Start_date, End_date,Interval)
- Start Date – is the smaller one between the two dates
- End Date – is the larger date
- Interval – “d” (in double quotes) will give you the number of days between the two dates. The interval between two dates can be specified in 6 ways
- “d” – will return the number of days
- “m” – will return the number of months between the two dates
- “y” – will return the number of years between the two dates
- “md” – will return the number of days after last completed month
- “ym” – will return the number of completed months after last completed year
- “yd” – will return the number of days after last completed year
Some more examples
Here is how dated if works for different versions of intervals specified
More on application of Date Functions
- Time Scales in Financial Modeling – Part 1
- Time Scales in Financial Modeling – Part 2
- Finding the correct quarter number