How do I calculate months between Start Date and End Date?
Best Answer
-
The formula below will return the number of months between a Start Date and an End Date. Note that the formula first tests to see whether the Start Date is blank or if the End Date is blank. If the Start Date is empty, then zero months are calculated. If the End Date is empty, then the difference between the Start Date and the current period is calculated using the START() function. Therefore, the Line Item containing this formula must be on a monthly timescale.
IF ISBLANK(Start Date) THEN 0 ELSE IF ISBLANK(End Date) THEN YEAR(START()) *12 + MONTH(START()) - (YEAR(Start Date) * 12 + MONTH(Start Date)) ELSE YEAR(End Date) * 12 + MONTH(End Date) - (YEAR(Start Date) * 12 + MONTH(Start Date)).1
Answers
-
note that what is critical here are 2 time based functions: MONTH() AND YEAR() which return in a number formatted line item the value of the month and the year of the date formatted line items
0