Results 1 to 4 of 4
  1. #1
    Star Lounger
    Join Date
    Apr 2001
    Location
    new york city
    Posts
    98
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Excel Function Question (Excel 97)

    Is there a formula that will determine the number of years, months and days that someone has been employed with an institution? If you know the person's start date...what function can I use to determine this information.

  2. #2
    3 Star Lounger
    Join Date
    Jun 2001
    Location
    Maidstone, Kent, England
    Posts
    398
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Excel Function Question (Excel 97)

    Check out the "datedif" function in help

    HTH

    Peter

  3. #3
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Excel Function Question (Excel 97)

    If the start date is in A1:

    =DATEDIF(A1,NOW(),"y") & " years, " & DATEDIF(A1,NOW(),"ym") & " months, " & DATEDIF(A1,NOW(),"md") & " days"

    Will give you the a text string with all the info.

    Steve

  4. #4
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Excel Function Question (Excel 97)

    If I remember correctly, datedif is missing from Xl97 Help. It is there in the XL2000 help file:

    DATEDIF
    See also

    Calculates the number of days, months, or years between two dates. This function is provided for compatibility with Lotus 1-2-3.

    Syntax

    DATEDIF(start_date,end_date,unit)

    Start_date is a date that represents the first, or starting, date of the period. Dates may be entered as text strings within quotation marks (for example, "2001/1/30"), as serial numbers (for example, 36921, which represents January 30, 2001, if you're using the 1900 date system), or as the results of other formulas or functions (for example, DATEVALUE("2001/1/30")). For more information about date serial numbers, see NOW.

    End_date is a date that represents the last, or ending, date of the period.

    Unit is the type of information you want returned.

    Unit Returns
    "Y" The number of complete years in the period.
    "M" The number of complete months in the period.
    "D" The number of days in the period.
    "MD" The difference between the days in start_date and end_date. The months and years of the dates are ignored.
    "YM" The difference between the months in start_date and end_date. The days and years of the dates are ignored.
    "YD" The difference between the days of start_date and end_date. The years of the dates are ignored.


    Remarks

    Microsoft Excel stores dates as sequential serial numbers so that it can perform calculations on them. Excel stores January 1, 1900, as serial number 1 if your workbook uses the 1900 date system. If your workbook uses the 1904 date system, Excel stores January 1, 1904, as serial number 0 (January 2, 1904, is serial number 1). For example, in the 1900 date system, Excel stores January 1, 1998, as serial number 35796 because it is 35,795 days after January 1, 1900. Learn more about how Microsoft Excel stores dates and times.


    Excel for Windows and Excel for the Macintosh use different date systems as their default. For more information, see NOW.
    Examples

    DATEDIF("2001/1/1","2003/1/1","Y") equals 2, or two complete years in the period.

    DATEDIF("2001/6/1","2002/8/15","D") equals 440, or 440 days between June 1, 2001, and August 15, 2002.

    DATEDIF("2001/6/1","2002/8/15","YD") equals 75, or 75 days between June 1 and August 15, ignoring the years of the dates.

    DATEDIF("2001/6/1","2002/8/15","MD") equals 14, or the difference between 1 and 15
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

Posting Permissions

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