+ Reply to Thread
Results 1 to 3 of 3

Date Difference

  1. #1
    Jaz
    Guest

    Date Difference

    How would I create a formula that takes 2 different dates and determines the
    number of years between them to the nearst tenth of a year.

    For example, the difference between 1/1/03 and 7/1/05 is 2.6 years.

    If I use the DATEDIF function, I only get a rounded number.

    Any ideas?

    Thanks,
    Jasper



  2. #2
    Stephen
    Guest

    Re: Date Difference

    "Jaz" <jrecto99@yahoo.com> wrote in message
    news:u5UgpRIEGHA.2724@TK2MSFTNGP12.phx.gbl...
    > How would I create a formula that takes 2 different dates and determines
    > the
    > number of years between them to the nearst tenth of a year.
    >
    > For example, the difference between 1/1/03 and 7/1/05 is 2.6 years.
    >
    > If I use the DATEDIF function, I only get a rounded number.
    >
    > Any ideas?
    >
    > Thanks,
    > Jasper
    >
    >


    Dates are stored as numbers where 1 represents 1 day. So, subtracting one
    date from the other will give the number of days difference. Dividing by
    365.25 will then give the number of years, which you can round to one
    decimal place:
    =ROUND((A2-A1)/365.25,1)
    You will need to format the result cell as general or number.

    BTW, the difference between your two dates is 2.5 years, not 2.6.



  3. #3
    Roger Govier
    Guest

    Re: Date Difference

    Hi Jaz

    In addition to Stephen's method, Datedif will give you more than just
    round years if required
    With 1/1/03 in A1, and 1/7/05 in B1
    Try
    =DATEDIF(A1,B1,"y")&" years "&DATEDIF(A1,B1,"ym")&" months
    "&DATEDIF(A1,B1,"md")&" days"
    which will return
    2 years 6 months 0 days
    or in decimal format
    =(DATEDIF(A21,B21,"y")+DATEDIF(A21,B21,"ym")/12)
    which will return 2.5

    --
    Regards

    Roger Govier


    Jaz <jrecto99@yahoo.com> wrote
    > How would I create a formula that takes 2 different dates and
    > determines the number of years between them to the nearst tenth of a
    > year. For example, the difference between 1/1/03 and 7/1/05 is 2.6
    > years. If I use the DATEDIF function, I only get a rounded number.
    > Any ideas?
    > Thanks,
    > Jasper






+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1