Solved

Help with Formula

Posted on 2011-02-17
4
235 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
  • 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
PaperPort has a feature called the "Send To Bar". It provides a convenient, drag-and-drop interface for using other installed software, such as Microsoft Office. However, this article shows that the latest Office 2016 apps (installed with an Office …
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
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.

757 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

23 Experts available now in Live!

Get 1:1 Help Now