Dating age difference formula
And now, let's see how you can use the Excel DATEDIF function to compare dates in your worksheets and return the difference.
The Excel DATEDIF function returns the number of complete calendar months between the dates, while the YEAR/MONTH formula operates on months' numbers.
In your DATEDIF formulas, you can input the dates is various ways, such as: Unit - the time unit to use when calculating the difference between two dates.
By supplying different units, you can get the DATEDIF function to return the date difference in days, months or years.
If your data set may contain such dates, you will find the solution in the next examples.
An alternative way to calculate the number of months between two dates in Excel is using the MONTH function, or more precisely a combination of MONTH and YEAR functions: Of course, this formula is not so transparent as DATEDIF and it does take time to wrap your head around the logic.