# Thread: Calculate # of months from January (2003/SP2)

1. ## Calculate # of months from January (2003/SP2)

I need to calculate the number of months from January of the current year through, and including, the month a loan closes + 2 months

E2 contains the loan closing date shown as: 1/0/00

We are escrowing taxes, and the number of months will then be used to determine the \$ amount to be escrowed (which calculation has already been set up).

2. ## Re: Calculate # of months from January (2003/SP2)

=DATEDIF(DATE(YEAR(TODAY()),1,1),E2,"m")+3

The datediff gets your from Jan1 to the start of the month. Adding the 3 gets you to the end of the month and adds 2 more.

Steve

3. ## Re: Calculate # of months from January (2003/SP2)

Try this formula - added: Steve's version is simpler
<code>
=DATEDIF(DATE(YEAR(TODAY()),1,1),DATE(YEAR(E2),MON TH(E2)+2,1),"M")+1
</code>
DATE(YEAR(TODAY()),1,1) is the 1st of January of the current year.

DATE(YEAR(E2),MONTH(E2)+2,1) is the 1st day of the month 2 months after the loan closing date.

The largely undocumented DATEDIF function calculates the difference in months. Since you want to include the start and end month, 1 is added.