Sunday, December 7, 2014

DATEDIF a hidden excel function

 DATEDIF returns the difference between two date values, based on the interval specified.

SYNTAX

The syntax for the Microsoft Excel DATEDIF function is:


DATEDIF( start_date, end_date, interval )

Here Interval could be one of Y, M, D or YM, YD, MD. 

Where:

Y gives the number of complete years between two dates.
M gives the number of complete months between two dates &
D  gives the number of days between two dates.



Since we got competed year in Y parameter, month in M parameter, reminder can be obtained using following parameters;

YM gives the difference between the months here days and years are ignored.
YD gives the difference between the days and years and dates are ignored.

Whereas MD gives the difference between the days and months and years are ignored.

See below for example: