x
Solved

# Calculate difference in dates in excel

Posted on 2013-02-05
Medium Priority
387 Views
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
0
Question by:edreamers
• 3
• 2

LVL 39

Accepted Solution

nutsch earned 2000 total points
ID: 38856363
If your dates are going to be first of the month, last of the month, use
=ROUND((B1-A1)/30,0)

Thomas
0

LVL 23

Expert Comment

ID: 38856398
or possibly:

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

LVL 50

Expert Comment

ID: 38856399
DATEDIF can be used to calculate the number of months between 2 dates, e.g.

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

regards, barry
0

LVL 50

Expert Comment

ID: 38856405
@NBVC - looks like I'm stalking you!
0

LVL 23

Expert Comment

ID: 38856448
And vice-versa, LOL.

Maybe we're both bored :(
0

LVL 50

Expert Comment

ID: 38856808
>=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

## Featured Post

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.