+ Reply to Thread
Results 1 to 10 of 10

Multiple Criteria Count

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    07-12-2015
    Location
    Dubai,UAE
    MS-Off Ver
    Office 365
    Posts
    447

    Multiple Criteria Count

    A 2
    B 2
    C 1
    B 3
    C 4


    In the following table, I would like to count the no. of instances where the value in first column is A or B and value in 2nd column is 1 or 2.



    So the count will be 2 in this case

  2. #2
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.96 for Mac MS 365
    Posts
    8,697

    Re: Multiple Criteria Count

    =countifs(A:A,"A",B:B,2) Should work.

    EDIT: too early reread, =countifs(A:A,"A",B:B,2)+countifs(A:A,"B",B:B,2) is one option (corrected first version with two conditions).
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Forum Contributor
    Join Date
    07-12-2015
    Location
    Dubai,UAE
    MS-Off Ver
    Office 365
    Posts
    447

    Re: Multiple Criteria Count

    Hi Sambo kid,

    Your formula does not count for 1

  4. #4
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2024
    Posts
    6,179

    Re: Multiple Criteria Count

    Try:

    =SUMPRODUCT(((A1:A10="A")+(A1:A10="B"))*((B1:B10=1)+(B1:B10=2)))

  5. #5
    Forum Contributor
    Join Date
    07-12-2015
    Location
    Dubai,UAE
    MS-Off Ver
    Office 365
    Posts
    447

    Re: Multiple Criteria Count

    Quote Originally Posted by Phuocam View Post
    Try:

    =SUMPRODUCT(((A1:A10="A")+(A1:A10="B"))*((B1:B10=1)+(B1:B10=2)))
    Works perfect!!!

  6. #6
    Forum Contributor
    Join Date
    07-12-2015
    Location
    Dubai,UAE
    MS-Off Ver
    Office 365
    Posts
    447

    Re: Multiple Criteria Count

    I was curious to know if any solution is posible giving the criteria within the curly brackets.( in case of large no. of criteria)

    {1,2} {"A","B"}

  7. #7
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2024
    Posts
    6,179

    Re: Multiple Criteria Count

    Quote Originally Posted by chullan88 View Post
    I was curious to know if any solution
    is posible giving the criteria within the curly brackets.
    ( in case of large no. of criteria)
    {1,2} {"A","B"}
    Here's ...

    =SUM(COUNTIFS(A1:A10,{"A","B"},B1:B10,{1;2}))

  8. #8
    Forum Contributor
    Join Date
    07-12-2015
    Location
    Dubai,UAE
    MS-Off Ver
    Office 365
    Posts
    447

    Re: Multiple Criteria Count

    Thanks!!

    I had tried the above formula once but couldn't get it right as I had used comma for sperating 1 and 2 within the curly brackets
    But with the semicolon,its giving the correct result
    Could you explain what is the difference?

  9. #9
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Multiple Criteria Count

    or if you prefer a long-winded option
    =COUNTIFS(A1:A5,"A",B1:B5,1)+COUNTIFS(A1:A5,"A",B1:B5,2)+COUNTIFS(A1:A5,"B",B1:B5,1)+COUNTIFS(A1:A5,"B",B1:B5,2)

  10. #10
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.96 for Mac MS 365
    Posts
    8,697

    Re: Multiple Criteria Count

    Sorry, just got up and need caffeine, not only did I miss the B in the first formula but also the 1. Sumproduct is a better option.
    looks like you got it solved though.

+ 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: 1
    Last Post: 07-05-2016, 06:35 AM
  2. Count cells if any criteria are met, not multiple criteria
    By jesstaylor in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-03-2014, 12:50 PM
  3. Count number of Rows with multiple criteria (multiple valued cells)
    By garog in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 03-09-2014, 01:33 PM
  4. Multiple Criteria search and COUNT FOR TEXT across multiple sheet ARRAY's
    By akaushik25 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-25-2014, 08:58 AM
  5. Replies: 1
    Last Post: 02-21-2014, 09:09 PM
  6. Count statement wtih multiple criteria only showing results for one criteria
    By uhlabomber in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-17-2013, 02:47 PM
  7. Count Multiple Entries, Return Multiple Rows, Based On 3 Criteria
    By gtj_global in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-20-2008, 06:40 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