+ Reply to Thread
Results 1 to 8 of 8

Add additional criteria to COUNTIF based on a list

  1. #1
    Forum Contributor
    Join Date
    11-06-2007
    Posts
    123

    Add additional criteria to COUNTIF based on a list

    Hi

    I have managed to get a Total count of current employees in a particular month, I would like to breakdown this count by individual Practice Areas i.e. the counts for each month in each Practice Area.

    Please see attached.

    Thanks

    Kind regards

    Cortlyn
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,980

    Re: Add additional criteria to COUNTIF based on a list

    You just add another condition, so:

    =COUNTIFS(Leaving_Date,">="&I$1,Leaving_Date,"<="&EOMONTH(I$1,0),Practice_Area,I9)+COUNTIFS(Leaving_Date,"",Practice_Area,I9)

    and:

    =COUNTIFS(Leaving_Date,">="&I$1,Leaving_Date,"<="&EOMONTH(I$1,0),Practice_Area,I25)

    HOWEVER these will return 0 in your sample data, as there are no practices assigned to any leavers in June 2014 in your data sample!!!
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Expert tim201110's Avatar
    Join Date
    10-23-2011
    Location
    Russia
    MS-Off Ver
    2016, 2019
    Posts
    2,357

    Re: Add additional criteria to COUNTIF based on a list

    changed formula in row 2 =COUNTIFS(Leaving_Date,">="&I$1,Leaving_Date,"<="&EOMONTH(I$1,0))+COUNTIFS(Leaving_Date,"=""",$D$2:$D$4093,"<"&I$1)
    in your table column Practice Area is empty for 2014
    Attached Files Attached Files

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,980

    Re: Add additional criteria to COUNTIF based on a list

    Quote Originally Posted by tim201110 View Post
    changed formula in row 2 =COUNTIFS(Leaving_Date,">="&I$1,Leaving_Date,"<="&EOMONTH(I$1,0))+COUNTIFS(Leaving_Date,"=""",$D$2:$D$4093,"<"&I$1)
    Why have you changed that formula?

    The continuous service data column does not come into the equation. Please see the thread in question where that part of Cortlyn's issue was dealt with: https://www.excelforum.com/excel-gen...-criteria.html
    Last edited by AliGW; 07-16-2017 at 02:40 AM.

  5. #5
    Forum Expert tim201110's Avatar
    Join Date
    10-23-2011
    Location
    Russia
    MS-Off Ver
    2016, 2019
    Posts
    2,357

    Re: Add additional criteria to COUNTIF based on a list

    in order to count only current employees
    PS seems that next conditions in COUNTIFS: "=""", "", "<>0" are different
    Attached Files Attached Files

  6. #6
    Forum Expert Tsjallie's Avatar
    Join Date
    09-15-2012
    Location
    NL
    MS-Off Ver
    2010, 2013, 2016
    Posts
    2,077

    Re: Add additional criteria to COUNTIF based on a list

    I think tim201110 is right. The original requirement was to count the current employees. Then you need the Continuous Service Date (assuming that's the date they enter the service).
    Changed the formula to use that column and also sumproduct. That's actually doing the same as countif, but with the advantage that you can evaluate parts of the formula.
    If you get unexpected results then you figure out what part causes it.
    Formula for calculating the headcount at start of a period and a practice.
    Assumed tha Continuous Servce Date is the date entering the service.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Formula for calculating the leavers in a period for a practice:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    And shouldn't you also count the newcomers?
    See attachment.
    Attached Files Attached Files
    Cheers!
    Tsjallie




    --------
    If your problem is solved, pls mark the thread SOLVED (see Thread Tools in the menu above). Thank you!

    If you think design is an expensive waste of time, try doing without ...

  7. #7
    Forum Contributor
    Join Date
    11-06-2007
    Posts
    123

    Re: Add additional criteria to COUNTIF based on a list

    Thank you very much AliGM
    Thank you very much tim201110
    Thank you very much Tsjallie

    Your assistance is very much appreciated.

    Kind regards

    Cortlyn

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,980

    Re: Add additional criteria to COUNTIF based on a list

    You're 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. Replies: 8
    Last Post: 11-15-2016, 03:47 AM
  2. Replies: 4
    Last Post: 11-10-2015, 01:11 AM
  3. [SOLVED] Sum of values based on values in different column with additional criteria
    By jimmyb555 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-15-2015, 02:31 PM
  4. COUNTIF Formula with additional criteria
    By thackett114 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-30-2014, 09:23 PM
  5. [SOLVED] Count unique values in a list with additional criteria
    By Craig K. in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-31-2013, 10:43 AM
  6. COUNTIF help based one two criteria, one being a list
    By ride_op in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 12-06-2010, 09:24 PM
  7. Count Unique Names in list w/ Additional Criteria?
    By Nodak in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-25-2005, 08:06 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