+ Reply to Thread
Results 1 to 20 of 20

counting unique values with multiple criteria

  1. #1
    Registered User
    Join Date
    11-30-2016
    Location
    Toronto
    MS-Off Ver
    Excel 2010
    Posts
    13

    counting unique values with multiple criteria

    Hi There,

    I'm a relative novice at Excel and I'm having trouble working out a formula.

    I'm trying to count the unique numbers in ROW G (Sectors) if certain criteria are met in other cells. For example,
    IF (1_hypothesis = 9) AND (1_for/against = D OR 1_for/against = CF) AND (1_thick/thin = Thick) AND (2_hypothesis = 9) AND (2_for/against = D OR 2_for/against = CF) AND (2_thick/thin = Thick), I want it to count the number of unique numbers in Sectors (Row G).

    I've tried SUM (with FREQUENCY, MATCH) and I get mostly there, but it stops working when I add more criteria.

    If anyone could provide me with the formula, that would be great.

    Thanks so much!!

    Screen Shot 2016-11-30 at 9.06.23 AM.png

  2. #2
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: counting unique values with multiple criteria

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

  3. #3
    Registered User
    Join Date
    11-30-2016
    Location
    Toronto
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: counting unique values with multiple criteria

    Hi,

    Thank you for your help! It mostly works. The only issue is that it's doing a count of all things that fit the criteria rather than simply counting UNIQUE numbers. In the example above, there number returned should be 2, but I'm getting 3 (the total number of cells that meet the criteria). Is there a way to have it count the UNIQUE values?

    Thanks again for your help!

  4. #4
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: counting unique values with multiple criteria

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


    See the file
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    11-30-2016
    Location
    Toronto
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: counting unique values with multiple criteria

    Now I get #N/A

  6. #6
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: counting unique values with multiple criteria

    Is this error in the file I attached?

    Please, can you send me the formula you are using, or attach a workbook?

  7. #7
    Registered User
    Join Date
    11-30-2016
    Location
    Toronto
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: counting unique values with multiple criteria

    I've attached my workbook. Thanks!
    Attached Files Attached Files

  8. #8
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: counting unique values with multiple criteria

    See the file and send me feedback for my formula
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    11-30-2016
    Location
    Toronto
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: counting unique values with multiple criteria

    I think I need to clarify what I'm looking for.

    I'm looking for a formula that will count the UNIQUE values in Column G with the following criteria:

    [IF (1_hypothesis = 9) AND (1_for/against = D OR 1_for/against = CF) AND (1_thick/thin = Thick)]

    OR

    [(2_hypothesis = 9) AND (2_for/against = D OR 2_for/against = CF) AND (2_thick/thin = Thick)]

    Thanks!

  10. #10
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: counting unique values with multiple criteria

    Hi
    Sorry for my mistake. Regular formula is
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    which gives you the value 2 (Sectors 1 and 2).
    See the file
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    11-30-2016
    Location
    Toronto
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: counting unique values with multiple criteria

    Almost there! The result is correct when column G is as is. But when I test it making all the "sectors" either 2 or 1, the result is not consistent. See worksheet Test1 and Test 2.
    Attached Files Attached Files

  12. #12
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: counting unique values with multiple criteria

    I only succeeded with a help column.

    Use this array formula in K2:K9
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    then use the following formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    See the file
    Attached Files Attached Files
    Last edited by José Augusto; 12-01-2016 at 02:52 PM.

  13. #13
    Registered User
    Join Date
    11-30-2016
    Location
    Toronto
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: counting unique values with multiple criteria

    Hi,
    Can you reattach the file. When I open it, it appears to be corrupt.

    Thanks!

  14. #14
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: counting unique values with multiple criteria

    Ok.

    Here is the file
    Attached Files Attached Files

  15. #15
    Registered User
    Join Date
    11-30-2016
    Location
    Toronto
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: counting unique values with multiple criteria

    Thank you! It's a bit laborious, but it does work.

    Just to add another wrinkle, what if I add another criteria? I'd like to add a fourth criteria to each part, but when I try, it doesn't work. Any suggestions? See attachment -- the orange are what the correct pathways should be.
    Attached Files Attached Files

  16. #16
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: counting unique values with multiple criteria

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

  17. #17
    Registered User
    Join Date
    11-30-2016
    Location
    Toronto
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: counting unique values with multiple criteria

    All the answers are 2 and the unique number is 1 (should be 2).
    Attached Files Attached Files

  18. #18
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: counting unique values with multiple criteria

    Hi
    See the formula in M2
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    It's include ROW(A1:A100) and ROW(A1:A101) to count unique numbers graters than 0 and less than 100 for distinct Sectors.

    See test2 in the file
    Attached Files Attached Files

  19. #19
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2404
    Posts
    13,407

    Re: counting unique values with multiple criteria



    In post #15 orange pathways ... isn't A6:D6 also a correct pathway and therefore I6 should be included?
    Dave

  20. #20
    Registered User
    Join Date
    11-30-2016
    Location
    Toronto
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: counting unique values with multiple criteria

    Quote Originally Posted by FlameRetired View Post


    In post #15 orange pathways ... isn't A6:D6 also a correct pathway and therefore I6 should be included?
    No, because D6=5, not 1.

+ 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] Counting unique values with multiple criteria
    By f.bomb in forum Excel General
    Replies: 5
    Last Post: 08-13-2014, 05:00 AM
  2. [SOLVED] Help counting unique values from column meeting multiple criteria
    By Starchild in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-28-2014, 01:25 PM
  3. [SOLVED] Counting Unique/Different Values based on multiple Criteria
    By jdodz in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-22-2014, 05:41 PM
  4. Counting Unique Values on Multiple Criteria
    By buhwheet in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 01-10-2014, 01:32 AM
  5. Counting unique values that meet multiple criteria
    By msworkman in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-08-2013, 11:15 PM
  6. [SOLVED] Counting Unique Values with Multiple Criteria
    By smwbuddy in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-15-2013, 08:35 PM
  7. Counting Unique Values with Multiple Criteria
    By CELIA.NEFF in forum Excel General
    Replies: 10
    Last Post: 02-15-2012, 11:31 AM

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