RE: Formulas
Dear Co
The DATEDIF function computes the difference between two dates in a variety of different intervals, such number of years, months, or days.
This function is available in all versions of Excel since at least version 5/95, but was entered as a form of “Easter Egg” and does not appear in the Function dialogbox.
Do not confuse the DATEDIF worksheet function with the DateDiff VBA function.
The syntax for DATEDIF is as follows:
=DATEDIF(Date1, Date2, Interval)
Where:
Date1 is the first date,
Date2 is the second date,
Interval is the interval type to return.
If Date1 is later than Date2, DATEDIF will return a #NUM! error.
If either Date1 or Date2 is not a valid date, DATEDIF will return a #VALUE error.
The Interval value should be one of
m - Months - Complete calendar months between the dates.
d - Days - Number of days between the dates.
y - Years - Complete calendar years between the dates.
ym - Months Excluding Years - Complete calendar months between the dates as if they were of the same year.
yd - Days Excluding Years - Complete calendar days between the dates as if they were of the same year.
md - Days Excluding Years And Months - Complete calendar days between the dates as if they were of the same month and same year.
If Interval is not one of the items listed in above, DATEDIF will return a #NUM error.
If you are including the Interval string directly within the formula, you must enclose it in double quotes:
=DATEDIF(Date1,Date2,"m")
If you have the interval in another cell referenced by the formula, that cell should not have quotes around the interval string. For example, with the formula
=DATEDIF(Date1,Date2,A1)
cell A1 should contain m not "m".
Hope this helps
Carlos