Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Calculate difference in dates in excel

Posted on 2013-02-05
6
Medium Priority
?
383 Views
Last Modified: 2013-02-05
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
Comment
Question by:edreamers
  • 3
  • 2
6 Comments
 
LVL 39

Accepted Solution

by:
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

by:NBVC
ID: 38856398
or possibly:

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

Expert Comment

by:barry houdini
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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
LVL 50

Expert Comment

by:barry houdini
ID: 38856405
@NBVC - looks like I'm stalking you!
0
 
LVL 23

Expert Comment

by:NBVC
ID: 38856448
And vice-versa, LOL.

Maybe we're both bored :(
0
 
LVL 50

Expert Comment

by:barry houdini
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

Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

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…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question