Calculate difference in dates in excel

i have one column A in which we have date suppose 1-1-2006 and in another column B we have another date suppose 31-5-2006. we want that in column C, it will automatically calculate the difference in months between two columns. So the result in column C will be 5.

kindly help
edreamersAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
nutschConnect With a Mentor Commented:
If your dates are going to be first of the month, last of the month, use
=ROUND((B1-A1)/30,0)

Thomas
0
 
NBVCCommented:
or possibly:

=DATEDIF(A1,B1,"m")+1
0
 
barry houdiniCommented:
DATEDIF can be used to calculate the number of months between 2 dates, e.g.

=DATEDIF(A1,B1+1,"m")

regards, barry
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
barry houdiniCommented:
@NBVC - looks like I'm stalking you!
0
 
NBVCCommented:
And vice-versa, LOL.

Maybe we're both bored :(
0
 
barry houdiniCommented:
>=ROUND((B1-A1)/30,0)

Thomas's suggested formula might not give you the desired results if A1 and B1 are further apart than a few months, e.g. 1-1-2006 to 31-12-2008 results in 37

regards, barry
0
All Courses

From novice to tech pro — start learning today.