+ Reply to Thread
Results 1 to 4 of 4

Count Unique Values in a Filtered Column

  1. #1
    Registered User
    Join Date
    06-18-2007
    MS-Off Ver
    2007
    Posts
    77

    Count Unique Values in a Filtered Column

    I need to count the number of unique names from a column of filtered text. On the attached example D5 is where I need the value, the current array I have does not work when the filter is applied by changing the product in drop box. I need to have a count of the unique account names from column A. Thanks.
    Attached Files Attached Files
    Last edited by mashley; 12-30-2008 at 10:58 AM.

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967
    I've used some user defined functions on the attachment to give a count of the visible items. I've used the range.Hidden property to help. I also had to get the combo box change event to reapply the formulae in order to get the UDF's to run.

    Hope this helps.
    Attached Files Attached Files
    Martin

  3. #3
    Valued Forum Contributor Richard Schollar's Avatar
    Join Date
    05-23-2006
    Location
    Hampshire UK
    MS-Off Ver
    Excel 2002
    Posts
    1,264
    I can't open your file I'm afraid as I only have xl2002 at work, but assuming your filter range is from A2:A100 (headers in A1) then you could use:

    =SUM(IF(FREQUENCY(IF(SUBTOTAL(3,OFFSET(A2,ROW(A2:A100)-ROW(A2),0)),MATCH(A2:A100,A2:A100,0)),MATCH(A2:A100,A2:A100,0)),1))

    which is an array formula and so must be confirmed with Ctrl+Shift+Enter (following successful entry, Excel will surround with curly braces {} - do not try entering these manually yourself!).

    Richard
    Richard Schollar
    Microsoft MVP - Excel

  4. #4
    Registered User
    Join Date
    06-18-2007
    MS-Off Ver
    2007
    Posts
    77
    These are two great solutions. Thanks for the help.

+ 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