+ Reply to Thread
Results 1 to 7 of 7

Years included in range

  1. #1
    Registered User
    Join Date
    08-19-2015
    Location
    Portland, Oregon
    MS-Off Ver
    Office 365 ProPlus
    Posts
    20

    Years included in range

    Hi,

    I need to build a formula that will tell me in which years an employee was employed.
    I think it involves some IF AND nesting formula and some extra columns.
    I figured I'd add a column for each of the possible years i.e. 2000, 2001, 2002.. and have it add a 1 to that column if they were employed during that year.
    Then I can see the totals of employees during that year with an easy sum at the bottom of the sheet.

    I'll attach a worksheet of data. "tempDateRange"
    You can see what I'm trying to do there.

    I got it started but it does not include all the employed dates in the table. Need more criteria.
    Attached Files Attached Files

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Years included in range

    Try this...
    =IF(AND(YEAR($B2)<=YEAR(G$1),YEAR($C2)>=YEAR(G$1)),1,0)
    copied down and across
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: Years included in range

    I29:I37 contain 2000,2001,....,20007
    In J29, then drag down
    =SUMPRODUCT(--(YEAR($B$2:$B$30)=I29))

  4. #4
    Registered User
    Join Date
    08-19-2015
    Location
    Portland, Oregon
    MS-Off Ver
    Office 365 ProPlus
    Posts
    20

    Re: Years included in range

    Im sure this was a great answer but I meant to comment on the previous post and cannot figure out how to delete this.
    Sorry.
    Last edited by Hilkiah; 04-11-2016 at 11:00 AM. Reason: replied to wrong person.

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Years included in range

    I dont see how the question you asked in post 1 could be considered a comment that was meant for another thread? what am I missing here?

  6. #6
    Registered User
    Join Date
    08-19-2015
    Location
    Portland, Oregon
    MS-Off Ver
    Office 365 ProPlus
    Posts
    20

    Re: Years included in range

    FDibbins. Your answer solved my problem. Thank you for your help.
    I attempted to add reputation to your answer.
    Let me know if it didn't go through.
    Thanks.

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Years included in range

    I got the rep, thank you, happy it worked for you

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 15
    Last Post: 12-18-2015, 02:25 PM
  2. [SOLVED] How to use SUM IF (or some other maybe?) with range of dates included
    By GRG Stevan in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-08-2015, 06:45 AM
  3. [SOLVED] Count items not included in a data validation range sourced from named range
    By L plates in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-10-2015, 01:05 PM
  4. Replies: 4
    Last Post: 02-10-2015, 04:51 AM
  5. Need to expand a range of years to individual years
    By chrissandu in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-26-2013, 10:46 AM
  6. [SOLVED] Age based on DOB; Accounts for leap years. Years old if >2, Months if <2 years old.
    By sharpmel in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 01-17-2013, 04:20 PM
  7. Replies: 4
    Last Post: 11-19-2010, 11:17 AM

Tags for this Thread

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