Calculate months between two dates in excel



=(YEAR(LastDate)-YEAR(EarlierDate))*12+MONTH(LastDate)-MONTH(EarlierDate)

=(YEAR(b1)-YEAR(a1))*12+MONTH(b1)-MONTH(a1)