+ Reply to Thread
Results 1 to 9 of 9

Thread: unique counting + filter

  1. #1
    Registered User
    Join Date
    07-02-2008
    Location
    oslo
    Posts
    18

    unique counting + filter

    I have a column that lists ID and I have another column that lists department
    I want to count the number of unique IDs but also limit them by department
    and I want to do this with a formula . not by filtering
    the counting without filtering is ok
    =sum(if(frequency(C:C;C:C)>0;1))
    where can I put in something like if(D:D="Sales")

  2. #2
    Extremely Helpful member
    Join Date
    12-23-2006
    Location
    Belgium
    MS-Off Ver
    XL2003
    Posts
    6,127
    Hi and welcome to the board
    can you post a small example of your data ?
    This will make things easier

    Thx
    Quoting entire posts clutters the forum and makes threads hard to read !

    If you are pleased with a member's answer then use the Star icon to rate it

    Click here to see forum rules

  3. #3
    Forum Guru
    Join Date
    06-18-2004
    Location
    Canada
    Posts
    1,329
    Try...

    =SUM(IF(FREQUENCY(IF(D2:D100="Sales",C2:C100),IF(D2:D100="Sales",C2:C100))>0,1))

    or

    =SUM(IF(FREQUENCY(IF(D2:D100="Sales",IF(C2:C100<>"",MATCH("~"&C2:C100,C2:C100&"",0))),ROW(C2:C100)-ROW(C2)+1)>0,1))

    Note that both formulas need to be confirmed with CONTROL+SHIFT+ENTER. Also, note that whole column references cannot be used.

    Hope this helps!

  4. #4
    Registered User
    Join Date
    07-02-2008
    Location
    oslo
    Posts
    18
    it did not work.

    the answer should be 7
    Attached Images Attached Images

  5. #5
    Registered User
    Join Date
    07-02-2008
    Location
    oslo
    Posts
    18
    yes it did work . I did a mistake by not ctrl + **** entering it

    thank you for helping out

    much appreciated

  6. #6
    Forum Guru
    Join Date
    06-18-2004
    Location
    Canada
    Posts
    1,329
    However, based on the sample data, if the formula should return 7 and not 8, the first formula would need to be changed to allow empty cells in Column C...

    =SUM(IF(FREQUENCY(IF(D2:D100="Sales",IF(C2:C100<>"",C2:C100)),IF(D2:D100="Sales",IF(C2:C100<>"",C2:C 100)))>0,1))

    ...confirmed with CONTROL+SHIFT+ENTER.

    Hope this helps!

  7. #7
    Registered User
    Join Date
    07-02-2008
    Location
    oslo
    Posts
    18
    thanks, what if I want to do the exact same thing but with sum not unique count ?

  8. #8
    Forum Guru
    Join Date
    06-18-2004
    Location
    Canada
    Posts
    1,329
    Note sure what you mean, can you be specific?

  9. #9
    Registered User
    Join Date
    07-02-2008
    Location
    oslo
    Posts
    18
    sorry for delayed feedback
    I solved it with a simple sumif

+ 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.2.0