+ Reply to Thread
Results 1 to 5 of 5

SUMPRODUCT, COUNTIF formulas not correctly counting based on two sets of criteria

  1. #1
    Registered User
    Join Date
    06-24-2013
    Location
    New York
    MS-Off Ver
    Excel 2011
    Posts
    24

    SUMPRODUCT, COUNTIF formulas not correctly counting based on two sets of criteria

    I've attached an Excel file to this post. For some reason, I can't find the right formula (i.e. I've tried SUMPRODUCT, COUNTIF, and other combinations) to correctly account the number of instances of a value appearing, based on satisfying two sets of criteria indexed in other columns. I'm thinking it's just a minor tweak of something that I missed. The attached file provides a lookup table, several of my attempts to solving the problem, and a restatement of my question with desired results versus actual results. Any help would be much appreciated.
    Attached Files Attached Files
    Last edited by justinbelkin; 12-11-2013 at 11:12 AM.

  2. #2
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: SUMPRODUCT, COUNTIF formulas not correctly counting based on two sets of criteria

    Is this what you want?

    =COUNTIF($C$3:$C$15,G3)
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  3. #3
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: SUMPRODUCT, COUNTIF formulas not correctly counting based on two sets of criteria

    Another way......

    Please Login or Register  to view this content.
    I think the correct one will be like this.......

    Please Login or Register  to view this content.
    Last edited by sktneer; 12-05-2013 at 01:17 PM.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: SUMPRODUCT, COUNTIF formulas not correctly counting based on two sets of criteria

    close but the first 2 should be
    =SUMPRODUCT(--($B:$B=$B$3),--($C:$C=$C$5))
    =COUNTIFS($B:$B,$B$3,$C:$C,$C$5)
    or
    more usable
    =SUMPRODUCT(--($B:$B="MCA"),--($C:$C="ACCOUNT MANAGER"))
    =COUNTIFS($B:$B,"MCA",$C:$C,"ACCOUNT MANAGER")
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  5. #5
    Registered User
    Join Date
    06-24-2013
    Location
    New York
    MS-Off Ver
    Excel 2011
    Posts
    24

    Re: SUMPRODUCT, COUNTIF formulas not correctly counting based on two sets of criteria

    Thank you to AlKey, sktneer, and martindwilson for your quick and accurate responses. To help future viewers of this post, I ended-up using sktneer's formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    This formula had the added benefit of not only returning the number of employees who satisfied 2 criteria (i.e. worked in MCA dept, and held the position of Account Manager), but also making sure that those employees are currently employed by ignoring all blanks in the month column. Great work! I've also added Reputation accordingly, and recommend other viewers to do the same when they're helped.

+ 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. Counting data sets based on multiple criteria
    By hjb0802 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-29-2010, 10:47 AM
  2. Counting a column based on two sets of criteria
    By Cjax in forum Excel General
    Replies: 4
    Last Post: 07-23-2009, 02:40 PM
  3. [SOLVED] COUNTIF or SUMPRODUCT counting multiple criteria
    By Kim in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-06-2005, 03:05 AM
  4. [SOLVED] COUNTIF or SUMPRODUCT counting multiple criteria
    By Kim in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-05-2005, 11:05 PM
  5. [SOLVED] COUNTIF or SUMPRODUCT counting multiple criteria
    By Kim in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-05-2005, 10:05 PM

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