+ Reply to Thread
Results 1 to 5 of 5

Counting unique text entries in a filtered list...

  1. #1
    Forum Contributor SOS's Avatar
    Join Date
    01-26-2004
    Location
    Glasgow, Scotland
    MS-Off Ver
    Excel 2003
    Posts
    327

    Counting unique text entries in a filtered list...

    Hi all,

    I'd like to be able to count unique text entries in Column A and have messed aroubd with the following formula:

    =SUM(IF(FREQUENCY(IF(LEN(A2:A100)>0,MATCH(A2:A100,A2:A100,0),""),
    IF(LEN(A2:A100)>0,MATCH(A2:A100,A2:A100,0),""))>0,1))

    entered as an array formula and it works.

    However I'd like to be able to apply that formula after I have filtered the worksheet on another column.

    Example:

    Name Gender
    John Male
    John Male
    Mary Female
    Margaret Female

    The above formula gives me the answer 3 (correctly). But when I filter the sheet on "Gender" as Male I'd like the answer to show 1.

    Does anyone know if this is possible?

    Many thanks

    Seamus

  2. #2
    Domenic
    Guest

    Re: Counting unique text entries in a filtered list...

    Try...

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

    ....confirmed with CONTROL+SHIFT+ENTER.

    Hope this helps!

    In article <[email protected]>,
    SOS <[email protected]> wrote:

    > Hi all,
    >
    > I'd like to be able to count unique text entries in Column A and have
    > messed aroubd with the following formula:
    >
    > =SUM(IF(FREQUENCY(IF(LEN(A2:A100)>0,MATCH(A2:A100,A2:A100,0),""),
    > IF(LEN(A2:A100)>0,MATCH(A2:A100,A2:A100,0),""))>0,1))
    >
    > entered as an array formula and it works.
    >
    > However I'd like to be able to apply that formula after I have filtered
    > the worksheet on another column.
    >
    > Example:
    >
    > Name Gender
    > John Male
    > John Male
    > Mary Female
    > Margaret Female
    >
    > The above formula gives me the answer 3 (correctly). But when I filter
    > the sheet on "Gender" as Male I'd like the answer to show 1.
    >
    > Does anyone know if this is possible?
    >
    > Many thanks
    >
    > Seamus


  3. #3
    Forum Contributor SOS's Avatar
    Join Date
    01-26-2004
    Location
    Glasgow, Scotland
    MS-Off Ver
    Excel 2003
    Posts
    327
    Domenic,

    Thanks for the reply. I pasted your example into my workbook as an array formula (CTR+SHIFT+ENTER) but ended up with #NAME? Error in the cell.

    Any ideas?

    Seamus

  4. #4
    Domenic
    Guest

    Re: Counting unique text entries in a filtered list...

    Since you copied/pasted the formula into your workbook, it's possible
    that a hard return may have been added. Try typing out the formula
    instead. Does that help?

    In article <[email protected]>,
    SOS <[email protected]> wrote:

    > Domenic,
    >
    > Thanks for the reply. I pasted your example into my workbook as an
    > array formula (CTR+SHIFT+ENTER) but ended up with #NAME? Error in the
    > cell.
    >
    > Any ideas?
    >
    > Seamus


  5. #5
    Forum Contributor SOS's Avatar
    Join Date
    01-26-2004
    Location
    Glasgow, Scotland
    MS-Off Ver
    Excel 2003
    Posts
    327
    Domenic,

    I typed the fomula in and it works perfectly. Many thanks for your input

    Seamus

+ 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