What is the output of =ROUND(9.6754,1)+SQRT(16)+MONTH(TODAY())-POWER(2,3)
Answers
Answered by
1
What is the output of =ROUND(9.6754,1)+SQRT(16)+MONTH(TODAY())-POWER(2,3)
Assuming the day of the month is irrelevant (i.e. the diff between 2011.1.1 and 2010.12.31 is 1), with date1 > date2 giving a positive value and date2 > date1 a negative value
((date1.Year - date2.Year) * 12) + date1.Month - date2.Month
Or, assuming you want an approximate number of 'average months' between the two dates, the following should work for all but very huge date differences.
date1.Subtract(date2).Days / (365.25 / 12)
Note, if you were to use the latter solution then your unit tests should state the widest date range which your application is designed to work with and validate the results of the calculation accordingly.
Similar questions
Math,
4 hours ago
Science,
4 hours ago
Social Sciences,
7 hours ago
Geography,
8 months ago
Science,
8 months ago