Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 6 of 6

Thread: date conversion

  1. #1
    Board Regular
    Join Date
    Mar 2002
    Location
    Jackson, MI
    Posts
    90
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    This is probably very basic, but:

    I need to do the following:

    today's date minus birthdate = years of service....

    thanks

  2. #2
    MrExcel MVP
    Join Date
    Mar 2002
    Location
    Michigan USA
    Posts
    11,454
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-03-27 11:32, gronkette1 wrote:
    This is probably very basic, but:

    I need to do the following:

    today's date minus birthdate = years of service....

    thanks
    Hi gronkette1:
    If birthdate is 3/1/81 and is entered in cell A1, then

    =year(today())-year(A1)

    will give you the age in years -- it may not necessarily give you the years of service ... Ha Ha!


    _________________
    Yogi Anand
    Edit: Deleted inactive web site reference from hard coded signature

    [ This Message was edited by: Yogi Anand on 2003-01-19 15:00 ]

  3. #3
    Board Regular
    Join Date
    Feb 2002
    Location
    Calgary, Alberta Canada
    Posts
    3,424
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default

    To calculate the difference in years,
    with Earliest Date in A1 and Latest date in B1, use =Datedif(A1,B1,"y") You could use today() for latest date.

    Note. Datedif is in most versions of Excel but it was only documented in Excel 2000.

    You can expand Datedif to show months, and days (Some anomalies with days). The following also includes text "Years" etc.

    =DATEDIF(A40,A38,"y")&" years, "&DATEDIF(A40,A38,"ym")&" months"

    [ This Message was edited by: Dave Patton on 2002-03-27 12:53 ]

  4. #4
    MrExcel MVP
    Join Date
    Mar 2002
    Location
    Michigan USA
    Posts
    11,454
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Note. Datedif is in most versions of Excel but it was only documented in Excel 2000.
    Thanks Dave:
    For resolving this mystery for me -- I know I could work with DATEDIF in Excel 97, but I couldn't find in the FUNCTION gallery!

  5. #5
    Board Regular
    Join Date
    Mar 2002
    Location
    Wellington
    Posts
    115
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi Dave,

    I have tried to find that DATEDIF function in Excel 97, but no luck.

    I guess my Excel version is not one of your "most versions" then.

    Thanks

  6. #6
    MrExcel MVP
    Join Date
    Mar 2002
    Location
    Michigan USA
    Posts
    11,454
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi BabyTiger:
    Have you tried using the function in Excel 97 -- as I mentioned in my post, I was familiar that the function existed and I could use the function in Excel 97, but I could not find it in the function gallery, nor could I find help on this function within Excel 97. So, give it a shot and use the function -- you may be pleasantly surprised that it does exist -- it is just not documented!

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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