+ Reply to Thread
Results 1 to 3 of 3

DATEDIF and leap years

  1. #1
    Leyland
    Guest

    DATEDIF and leap years

    I am using this formula to get the age of someone in years and days. It
    works well execpt I cannot find a way of adjusting for leap years. Any ideas

    =DATEDIF(A1,B1,"Y")&"YEARS"&DATEDIF(A1,B1."YD")&"DAYS"

  2. #2
    JE McGimpsey
    Guest

    Re: DATEDIF and leap years

    What isn't adjusting for you?

    A1: 2/28/2001
    B1: 3/1/2004 <== Leap year
    C1: 3 YEARS 2 DAYS


    A1: 2/28/2002
    B1: 3/1/2005 <== Non leap-year
    C1: 3 YEARS 1 DAYS

    Years are insensitive to leap-days (except for those born on 29
    February, I suppose), so only the last partial year matters. It appears
    to me that this adjusts fine.



    In article <[email protected]>,
    "Leyland" <[email protected]> wrote:

    > I am using this formula to get the age of someone in years and days. It
    > works well execpt I cannot find a way of adjusting for leap years. Any ideas
    >
    > =DATEDIF(A1,B1,"Y")&"YEARS"&DATEDIF(A1,B1."YD")&"DAYS"


  3. #3
    Leyland
    Guest

    Re: DATEDIF and leap years

    Sorry, my bad maths! I have run it again with no problems. Many thanks.

    "JE McGimpsey" wrote:

    > What isn't adjusting for you?
    >
    > A1: 2/28/2001
    > B1: 3/1/2004 <== Leap year
    > C1: 3 YEARS 2 DAYS
    >
    >
    > A1: 2/28/2002
    > B1: 3/1/2005 <== Non leap-year
    > C1: 3 YEARS 1 DAYS
    >
    > Years are insensitive to leap-days (except for those born on 29
    > February, I suppose), so only the last partial year matters. It appears
    > to me that this adjusts fine.
    >
    >
    >
    > In article <[email protected]>,
    > "Leyland" <[email protected]> wrote:
    >
    > > I am using this formula to get the age of someone in years and days. It
    > > works well execpt I cannot find a way of adjusting for leap years. Any ideas
    > >
    > > =DATEDIF(A1,B1,"Y")&"YEARS"&DATEDIF(A1,B1."YD")&"DAYS"

    >


+ 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