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

D

daddylonglegs

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)
 
J

John James

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top