+ Reply to Thread
Results 1 to 11 of 11

Calculate Headcount by department, based on Hire date and Termination date

  1. #1
    Registered User
    Join Date
    11-22-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    4

    Calculate Headcount by department, based on Hire date and Termination date

    Hi!

    I need a bit of help in figuring out what formula to use in order to calculate headcount/month/department, based on hire date & termination date.

    Sample of my data:
    excel.jpg

    Any help is much appreciated!

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Calculate Headcount by department, based on Hire date and Termination date

    An attached workbook would be more help than a JPG, so I can see what format your dates are stored in...
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Calculate Headcount by department, based on Hire date and Termination date

    =SUMPRODUCT(IF($B$2:$B$10<H$1,1,0)*IF($C$2:$C$10>H$1,1,IF($C$2:$C$10="",1,0))*IF($D$2:$D$10=$G2,1,0))
    In H2 as an array formula (confirm with ctrl+shift+enter)

    copy down and across.

    Please upload workbooks rather than images, means not having to type out all your data!
    Last edited by ragulduy; 11-22-2013 at 11:39 AM.

  4. #4
    Registered User
    Join Date
    11-22-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Calculate Headcount by department, based on Hire date and Termination date

    here it is. Thanks!

    sample headcount.xlsx

  5. #5
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Calculate Headcount by department, based on Hire date and Termination date

    Question - my formula will evaluate based on the first of the month.

    So in your example, when the employee starts on the 14th April, should they be included in the april figure?
    similarly, if an employee terminates on the 14th April, should they be included in the april figure?

    Note - you can do headcount for "at any point in month" by replacing all of the links to date cells with month(cell)

  6. #6
    Registered User
    Join Date
    11-22-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Calculate Headcount by department, based on Hire date and Termination date

    sorry! I'll now for the future.

  7. #7
    Registered User
    Join Date
    11-22-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Calculate Headcount by department, based on Hire date and Termination date

    if an employee starts on 14 April - will be counted in April headcount and going forward
    if the person leaven on 14 April - will be counted on all the months prior to leaving + April

  8. #8
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Calculate Headcount by department, based on Hire date and Termination date

    ok so try:
    =SUMPRODUCT(IF($B$2:$B$10<DATE(YEAR(H$1),MONTH(H$1)+1,DAY(H$1)),1,0)*IF($C$2:$C$10>DATE(YEAR(H$1),MONTH(H$1)-1,DAY(H$1)),1,IF($C$2:$C$10="",1,0))*IF($D$2:$D$10=$G2,1,0))
    in H2 as an array formula (confirm with ctrl+shift+enter) and copy down and across

  9. #9
    Registered User
    Join Date
    05-26-2015
    Location
    Boston, MA
    MS-Off Ver
    2010
    Posts
    1

    Re: Calculate Headcount by department, based on Hire date and Termination date

    Hi there, Is anyone available to assist with this thread? I've tried the formula above and it is not working for me.

  10. #10
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,612

    Re: Calculate Headcount by department, based on Hire date and Termination date

    @abeltran618,
    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
    Ben Van Johnson

  11. #11
    Registered User
    Join Date
    09-23-2019
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: Calculate Headcount by department, based on Hire date and Termination date

    Hi I had a similar query and this formula worked perfectly - thank you so much

+ 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. Formula to determine due date based on hire date
    By tastjuste in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-17-2013, 06:59 PM
  2. Replies: 0
    Last Post: 06-04-2013, 12:14 PM
  3. Require forumla to calculate age at date of termination
    By Stacey88 in forum Excel General
    Replies: 2
    Last Post: 06-29-2012, 04:12 AM
  4. Calculate # of Paychecks based on Date of Hire
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-21-2010, 12:39 PM
  5. Calculate # of Paychecks based on Date of Hire
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-22-2009, 07:27 PM

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