Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Calculate difference in dates in excel

Posted on 2013-02-05
6
Medium Priority
?
380 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

 
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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

This article describes a serious pitfall that can happen when deleting shapes using VBA.
Ever wonder what it's like to get hit by ransomware? "Tom" gives you all the dirty details first-hand – and conveys the hard lessons his company learned in the aftermath.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

609 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