Solved

How to calculate number of months between 2 dates

Posted on 2013-01-16
7
1,705 Views
Last Modified: 2013-01-24
I am trying to calculate the number of months between two dates.  The first date is the initial contact and the second date is the current date.  The current date will automatically update with today's date.  Then I will take that number and multiply it against a dollar amount.

Thanks in advance.
0
Comment
Question by:Vendettta
7 Comments
 
LVL 45

Expert Comment

by:Martin Liss
Comment Utility
Here's a Microsoft support article.
0
 
LVL 5

Expert Comment

by:albelo
Comment Utility
Assume you have the following in Excel

Cell A1: 6/7/2007
Cell A2: 6/9/2009

Fomula: =(YEAR(A2)-YEAR(A1))*12+MONTH(A2)-MONTH(A1)
0
 
LVL 50

Expert Comment

by:barry houdini
Comment Utility
DATEDIF counts whole months only, e.g.

=DATEDIF(A2,B2,"m")

or do you want fractions or rounding?

To round the nearest whole number of months

=DATEDIF(A2,B2+15,"m")

regards, barry
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:Vendettta
Comment Utility
The second date is going to be based off the system date.  Which will change automatically.  Each formula assumes a set date to be entered.  It needs to be tied to the system date.


I look forward to the update.
0
 
LVL 5

Expert Comment

by:albelo
Comment Utility
IF you used =today() in Cell A2 it would return system date and formula would remain the
same.

or

=(YEAR(TODAY())-YEAR(A1))*12+MONTH(TODAY())-MONTH(A1)
0
 
LVL 5

Expert Comment

by:albelo
Comment Utility
Make sure you format the cell with the formula as General or Number
0
 
LVL 50

Accepted Solution

by:
barry houdini earned 500 total points
Comment Utility
The same applies with my DATEDIF suggestion - this formula will return the number of whole months between a date in A2 and today's date

=DATEDIF(A2,TODAY(),"m")

so if A2 = 1/1/2013 then that will give you 0 because no full months have yet passed......but if you use my other suggestion, i.e.

=DATEDIF(A2,TODAY()+15,"m")

That will round to the nearest number of months - for my example 1

...or do you want a fractional number? If you do then try YEARFRAC like this

=YEARFRAC(A2,TODAY())*12

In all of those cases you can simply multiply by your dollar amount within the same formula if you like, e.g. with dollar amount in B2 that last one becomes.

=YEARFRAC(A2,TODAY())*12*B2

If none of those work for you perhaps consider posting a few representative examples - e.g. which dates you have and what results you require for those dates.

regards, barry
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Drop Down List with Unique/Distinct Values (enhancing the Combo-Box with a few steps and a little code) David miller (dlmille) Intro Have you ever created a data validation list from a database field or spreadsheet column (e.g., Zip Codes or Co…
Introduction This Article is a follow-up to my Mappit! Addin Article (http://www.experts-exchange.com/A_2613.html), it was inspired by an email posting I made to EUSPRIG (http://www.eusprig.org/index.htm), I will briefly cover: 1) An overvie…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now