You'll need to do this in 3 parts:
- Number of Months Start Date Month to the end of the year
- Number of Months from January to the End Date Month
- Number of Whole years between the Start Date and End Date
var date SD=[Start Date];
var date ED=[End Date];
//Number of Months in Start Year
var number sm = 13 - Month($sd);
//Number of Months in End Year
var number em = Month($ed);
//Number of Months between Start and End
var number wm = (Year($ED)-Year($SD)-1)*12;
//Total
$sm + $em + $wm
Alternatively, you can do it this way:
var date SD=[Start Date];
var date ED=[End Date];
// start off with 12 times the number of fully completed years
(Year($ED)-Year($SD)-1)*12
//add 12 months if the last year was fully completed
+If(Month($ED)>=Month($SD),12,0)
// add the number of months between the month numbers
+If((Month($ED)>=Month($SD)),Month($ED)-Month($SD),12+Month($ED)-Month($SD))
// but if the day did not catch up to the start date's day number, then subtract 1
-If(Day($ED)<Day($SD),1,0)
------------------------------
Blake Harrison
bharrison@datablender.io
DataBlender - Quickbase Solution Provider
Atlanta GA
404.800.1702 /
http://datablender.io/------------------------------