+ Reply to Thread
Results 1 to 2 of 2

Count Unique with IF

  1. #1
    Registered User
    Join Date
    09-25-2007
    Posts
    4

    Count Unique with IF

    Hey, I am trying to count the unique number of entries within an array. I know that I can use Frequency, Match and Sum to count the number of unique entries in a column, but can an if statement be added? For example in the table below: Can I count the unique number of DOG names only? And therefore not include the cat entries. So unique entries would be (3) in this case, rather than (5).


    Type Name
    dog henry
    cat fur
    dog henry
    dog rex
    dog suzie
    cat tuna


    Thanks!
    Last edited by VBA Noob; 10-05-2007 at 05:43 PM.

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    Here's one way

    =COUNT(1/FREQUENCY(IF(A2:A7="dog",MATCH(B2:B7,B2:B7,0)),ROW(B2:B7)-ROW(B2)+1))

    confirmed with CTRL+SHIFT+ENTER

+ 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