Solved

# Help with Formula

Posted on 2011-02-17
Medium Priority
248 Views
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
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
• 2
• 2

LVL 50

Expert Comment

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

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

barry houdini earned 2000 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

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

## Featured Post

Question has a verified solution.

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

Cancel future meetings from user mailboxes in Office 365 using Remove-CalendarEvents
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…
###### Suggested Courses
Course of the Month10 days, 9 hours left to enroll