Learn how to a build a cloud-first strategyRegister Now

x
Solved

# Calculate difference in dates in excel

Posted on 2013-02-05
Medium Priority
383 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.

If you are experiencing a similar issue, please ask a related question

Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
I came across an unsolved Outlook issue and here is my solution.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
###### Suggested Courses
Course of the Month20 days, 23 hours left to enroll