Solved

Help with Formula

Posted on 2011-02-17
4
241 Views
Last Modified: 2012-06-21
Hi,

I receive a spreadsheet daily from our suppliers which has customer data in it. One of the columns contains the start date of contract which is stored as dd/mm/yyyy.

I would like to transform this column into how many years/month the contract has been live.

Example: Start of Contract = 01/02/2008
Time in contract would be = 2yrs and 10months

Whats the best way to achieve this?
0
Comment
Question by:daiwhyte
[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
  • 2
  • 2
4 Comments
 
LVL 50

Expert Comment

by:barry houdini
ID: 34914935
If you have the start date in A2 then you can use this formula to give years and months duration up to today's date

=DATEDIF(A2,TODAY(),"y")&" years "&DATEDIF(A2,TODAY(),"ym")&" months"

If you want a specific end date rather than today you can replace TODAY() both times in the formula with a specific date, e.g. with that date in F1

=DATEDIF(A2,F$1,"y")&" years "&DATEDIF(A2,F$1,"ym")&" months"

regards, barry
0
 

Author Comment

by:daiwhyte
ID: 34915081
If I wanted split this into two so I can have one formula which works out the year and one formula which works out the month. Ive had a crack at splitting the above formula but alas with no luck.
0
 
LVL 50

Accepted Solution

by:
barry houdini earned 500 total points
ID: 34915314
You can use this for years

=DATEDIF(A2,TODAY(),"y")&" years"

and then this for months

=DATEDIF(A2,TODAY(),"ym")&" months"

If you just want the number, e.g. just 3 instead of 3 years then remove the & and everthing after

regards, barry
0
 

Author Closing Comment

by:daiwhyte
ID: 34915391
Thank you Barry, that is spot on.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

735 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