+ Reply to Thread
Results 1 to 7 of 7

DateDif

  1. #1
    Forum Contributor
    Join Date
    01-16-2009
    Location
    Ill.
    MS-Off Ver
    Excel 2010
    Posts
    190

    DateDif

    Hello - - I'm trying to wrap my head around this one...maybe it's Friday....!

    Anyway, I have a list of employees: Name, Supervisor and Service Date. I'm trying to add a column that would show the Years of Service for a future date range. The future date range would be Quarter 3 - 2009....I'm looking for those that would have a 5 year anniversary, 10 year, 15, 20...and so on...that would fall between July 2009 and Sep 2009...

    Any ideas, suggestions would be great! Thanks...and enjoy your weekend!

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    re: DateDif

    Are you looking to determine who is at 5, who is at 10, etc... or just who is a factor of 5 years anniversary during that period?
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Contributor
    Join Date
    01-16-2009
    Location
    Ill.
    MS-Off Ver
    Excel 2010
    Posts
    190

    re: DateDif

    Hi....Yeah, I would be looking to determine which employees will have their 5 year anniv., or those with a 10 year, or those with 15, 20, 30, 35, 40...etc.. fall between 7/1/2009 and 9/30/2009...make sense?

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    re: DateDif

    Have a look at the attached to see if this is close to what you need.

    I listed the months of interest (all 3 months have to be listed)... note that the first one starts at the last day of the prev. month..because of the way Datedif() works... If you use Jul 1, 2009, then July 1, 2004, doesn't register...
    Attached Files Attached Files

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: DateDif

    If you need to have the answers in one single column, you can add a column as shown in attached and hide the "worker" columns...
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    01-16-2009
    Location
    Ill.
    MS-Off Ver
    Excel 2010
    Posts
    190

    Re: DateDif

    Hi....I was just logging back in to the forum to make the vary statement, that I was looking for something more in the line of in one column. Thanks for your help.

  7. #7
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,702

    Re: DateDif

    For a single formula approach......

    With hire dates in A2 down use this formula in B2 down

    =IF(AND(INT((MONTH(A2)+2)/3)=F$1,MOD(D$1-YEAR(A2),5)=0),D$1-YEAR(A2),"")

    Where the required year and quarter are shown in D1 and F1, e.g. 2009 and 3 respectively for your example

    Only shows the number of years when a "significant anniversary" falls in the period you want.

    See attached
    Attached Files Attached Files
    Last edited by daddylonglegs; 05-08-2009 at 08:16 PM.

+ 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