Number of Months Between Two Dates (MONTHS)

Syntax: MONTHS(t1; t2)

The MONTHS function calculates the number of months between two dates, either in monthly intervals (0) or in calendar months (1). For example:

=MONTHS(DATE(2010; 1; 15); DATE(2010; 2; 1); 0)

returns 0, because the difference between these two dates is less than the length of one full month, and

=MONTHS(DATE(2010; 1; 15); DATE(2010; 2; 1); 1)

returns 1, because in calendar terms there is a difference of one month (in February, we think of January 15 as last month’s date).

images

Figure 12-15. Sample result of the MONTHS function

You can give MONTHS the date in a more natural ...

Get Beginning OpenOffice Calc: From Setting Up Simple Spreadsheets to Business Forecasting now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.