+ Reply to Thread
Results 1 to 3 of 3

Add Unique Items w/ Multi Criteria

  1. #1
    Registered User
    Join Date
    04-11-2005
    Posts
    9

    Add Unique Items w/ Multi Criteria

    I am trying to add up a list of items with multiple criteria. Here is an example piece of data

    NAME:..........PROB1:............PROB2:.............SEVERE:
    Bob..................X......................X.....................YES
    Bob..................X.............................................YES
    Charles....................................X.....................YES
    Charles...........................................................YES
    Charles............X......................X
    Keith................X......................X
    Keith................X.............................................YES
    Keith................X......................X.....................YES
    Keith................X

    I would like to count the number of times a Unique Name has Prob1 with value "X" and Severe with value "YES" (all three must be true for the row to count). Using this criteria the correct answer for this data is 2.

    I have this equation for calculating the number of unique names in the list: =SUMPRODUCT((IF(FREQUENCY(IF(LEN(A2:A1000)>0,MATCH(A2:A1000,A2:A1000,0),""),
    IF(LEN(A2:A1000)>0,MATCH(A2:A1000,A2:A1000,0),""))>0,1))

    And I have attempted to modify it to meet my criteria like this: =SUMPRODUCT((IF(FREQUENCY(IF(LEN(A2:A1000)>0,MATCH(A2:A1000,A2:A1000,0),""),
    IF(LEN(A2:A1000)>0,MATCH(A2:A1000,A2:A1000,0),""))>0,1))*(B2:B1000="X")*(D2:D1000="YES"))

    Obviously this equation is returning an error (#N/A) and I cannot figure out the correct way to implement this. I would greatly appreciate it if anyone could help me out with this. Thanks, Keith
    Last edited by mfx_krypt; 04-11-2005 at 11:16 AM. Reason: Confusing table

  2. #2
    Forum Expert
    Join Date
    06-18-2004
    Location
    Canada
    MS-Off Ver
    Office 2016
    Posts
    1,474
    Try the following...

    =SUM(IF(FREQUENCY(IF((LEN(A2:A10)>0)*(B2:B10="X")*(D2:D10="Yes"),MATCH(A2:A10,A2:A10,0)),ROW(INDIRECT("1:"&ROWS(A2:A10))))>0,1,0))

    OR

    =COUNT(1/FREQUENCY(IF((LEN(A2:A10)>0)*(B2:B10="X")*(D2:D10="Yes"),MATCH(A2:A10,A2:A10,0)),ROW(INDIRECT("1:"&ROWS(A2:A10)))))

    Both these formulas need to be confirmed with CONTROL+SHIFT+ENTER, not just ENTER.

    Hope this helps!

  3. #3
    Registered User
    Join Date
    04-11-2005
    Posts
    9
    Wow, very nice. Thank you that is exactly what I needed. I am going to have to put some study time into these commands.

    Thanks Again

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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