how many months between two dates
Hello All, Hello Phil,
I need to know how many months, if any, are included in a period of two dates, date1 and date2.
The formula I'm using as follows :
12 * ( Year ( date2 ) - Year ( date1) ) + Month ( date2) - Month ( date1) - ( Day ( date2) < Day ( date1) )
which gives me 1 month for the following dates : 01/01/2012 and 01/02/2012 . Ok.
But 0 month for 01/01/2012 and 31/01/2012.
Haven't been successfull yet trying to come up whith a valid formula.
Could you help ? Thanks in advance !