+ Reply to Thread
Results 1 to 12 of 12

How do i get a sum of monthly headcount using multiple criteria

  1. #1
    Registered User
    Join Date
    10-05-2015
    Location
    Hong Kong
    MS-Off Ver
    2007
    Posts
    9

    How do i get a sum of monthly headcount using multiple criteria

    hi all,

    I am working on a workbook and i would like to create a formula the could help to automatically calculate the variance of the monthly headcount (budget (which i will simply use cell reference for the budget part) - actual HC in current month). So i will need to create a formula for the actual monthly HC part with multiple criteria.

    The budget HC information has been input in a table already and information for current month will be consolidated using a pivot table.

    Since this is a bit complicated, i have created a dummy excel as attached.

    The sheet "Name list" contains the raw data that i will have to use for the "HC Report" in sheet 2.
    For example, in sheet 2 B17, i would like to calculate the variance of the position with a banding of "EX" in 'name List" C:C and micro function of "COR" in 'Name List' E:E in the current month which is October.

    I have typed =DATE(YEAR(TODAY()),MONTH(TODAY()),1) on top of the table as this might be needed in the formula that i would like to create.

    The monthly headcount has already been calculated in "Name List" starting from column H to S.

    I know this is probably a little bit long already. Now the problem is for the example of finding the October headcount with "COR" and "EX", i have created a formula of =COUNTIFS('Name List'!C:C,"EX",'Name List'!E:E,"COR") (please see E17 in Sheet 2) but i am not able to figure out how the formula can take into consideration of the HC information for the current month.

    I have tried adding the part of Column H:S / Last Date (YTD) (Column G) of Name List into the COUNTIF formula, however it does not work. I have tried using LOOKUP/MATCH functions as well but seems like it won't work.

    I understand this sounds complicated and I am not sure whether there would be a formula that can solve the problem at all.

    Also i am not sure whether this long passage has violate any rules of the forum but i hope you experts can kindly help with this. Thank heaps in advance.
    Attached Files Attached Files
    Last edited by mallory.chui; 10-13-2015 at 04:22 AM.

  2. #2
    Valued Forum Contributor mangesh.mehendale's Avatar
    Join Date
    06-04-2015
    Location
    India
    MS-Off Ver
    2007
    Posts
    510

    Re: How do i get a sum of monthly headcount using multiple criteria

    What is your desired result in sheet two B17 ????
    Last edited by mangesh.mehendale; 10-13-2015 at 12:44 AM.
    Don`t care, take care...

    Regards,
    Mangesh

  3. #3
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: How do i get a sum of monthly headcount using multiple criteria

    can you not just add in extra criteria for your countif?

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by humdingaling; 10-13-2015 at 12:48 AM. Reason: references corrected
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  4. #4
    Registered User
    Join Date
    10-05-2015
    Location
    Hong Kong
    MS-Off Ver
    2007
    Posts
    9

    Re: How do i get a sum of monthly headcount using multiple criteria

    thank you for the formula. I know I can simply add in an extra criteria with info in Q:Q, but i want to have a formula that will calculate the current month automatically instead of having to update the formula every month.

    I was thinking about using TODAY(), (B17=B7-COUNTIFS('Name List'!C:C,"EX",'Name List'!E:E,"COR",'Name List'!G:G,TODAY())) but then since some people leave in the month and we actually still count it into the monthly HC, there might be a limitation.

  5. #5
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: How do i get a sum of monthly headcount using multiple criteria

    firstly b13 does not match what you have in name list
    so make it 15 to match
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    then put into B17
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    the numbers will update based on month in b13
    Attached Files Attached Files

  6. #6
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: How do i get a sum of monthly headcount using multiple criteria

    In reference post #3 .

    We can use dynamic range for Q:Q column

    Try B17=COUNTIFS('Name List'!$C$4:$C$17,$A17,'Name List'!$E$4:$E$17,B$16,OFFSET('Name List'!$G$3,1,MATCH(MONTH('Sheet 2'!$B$13),INDEX(MONTH('Name List'!$H$3:$S$3),),0),14),">0") and drag over and down.

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  7. #7
    Registered User
    Join Date
    10-05-2015
    Location
    Hong Kong
    MS-Off Ver
    2007
    Posts
    9

    Re: How do i get a sum of monthly headcount using multiple criteria

    Thanks all!!!
    Both formulas look great and i am now thinking which one might suit better.
    May I know what exactly is a dynamic range tough?

  8. #8
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: How do i get a sum of monthly headcount using multiple criteria

    For last criteria we need dynamic range so according to your month - last criteria range would auto manage with this formula and you don't need to change anything in your file after applying this formulea

  9. #9
    Registered User
    Join Date
    10-05-2015
    Location
    Hong Kong
    MS-Off Ver
    2007
    Posts
    9

    Re: How do i get a sum of monthly headcount using multiple criteria

    ahhhh understand. but then for the [height] part of the OFFSET formula, in here 14 refers to the no of staff, what if there are more staff, then i will have to adjust it manual?!

  10. #10
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: How do i get a sum of monthly headcount using multiple criteria

    For avoiding 14 height and making dynamic.
    Try.

    B17=COUNTIFS('Name List'!$C$4:$C$17,$A17,'Name List'!$E$4:$E$17,B$16,OFFSET('Name List'!$G$3,1,MATCH(MONTH('Sheet 2'!$B$13),INDEX(MONTH('Name List'!$H$3:$S$3),),0),COUNT('Name List'!$P$4:$P$1200)-1),">0")

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    10-05-2015
    Location
    Hong Kong
    MS-Off Ver
    2007
    Posts
    9

    Re: How do i get a sum of monthly headcount using multiple criteria

    Thank you!!

  12. #12
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: How do i get a sum of monthly headcount using multiple criteria

    Your welcome

+ 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. [SOLVED] Headcount Forecasting
    By Shaun_Chetty in forum Excel General
    Replies: 17
    Last Post: 05-27-2015, 02:45 PM
  2. Monthly Headcount Change Stacked Column Waterfall
    By scampy74 in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 04-15-2015, 03:56 PM
  3. [SOLVED] Criteria Based Monthly Counts
    By simplyxl in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 08-17-2013, 09:16 AM
  4. Replies: 1
    Last Post: 07-17-2013, 11:34 AM
  5. Sumif with various criteria Distributed Monthly
    By rickyilas in forum Excel General
    Replies: 2
    Last Post: 12-20-2010, 04:00 AM
  6. Headcount Within Month
    By som3on3_10 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-25-2009, 03:37 AM
  7. Replies: 1
    Last Post: 07-11-2008, 05:57 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