How to calculate "number of months" between two given date?

  • Thread starter Thread starter Guest
  • Start date Start date
Hi nginhong

if this formula works for you...

=(YEAR(B3)-YEAR(A3))*12+MONTH(B3)-MONTH(A3)+IF(DAY(B3)>DAY(A3),1,0)

then this should too

=DATEDIF(A3,B3,"m")+(DATEDIF(A3,B3,"md")>0)
 
Allowing for negative date differences on cells B3 and A3:

moi:
=(YEAR(B3)-YEAR(A3))*12+MONTH(B3)-MONTH(A3)+IF(B3>A3,IF(DAY(B3)>DAY(A3),1,IF(B3<A3,-1,0)))

daddylonglegs:
=IF(B3>A3,DATEDIF(A3,B3,"m")+(DATEDIF(A3,B3,"md")>0),-(DATEDIF(B3,A3,"m")+(DATEDIF(B3,A3,"md")>0)))

How do you find the parameters for the datedif formula, given tha
there's no help in excel or on the web site
 
Back
Top