+ Reply to Thread
Results 1 to 8 of 8

Counting Unique Names based on Criteria

  1. #1
    Registered User
    Join Date
    06-26-2012
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2007
    Posts
    20

    Counting Unique Names based on Criteria

    I have attached a document that I need a formula for. In column B16, I need a formula that will count the number of unique people who are in radiology. As you can see, Adam, Ben, and Susan have radiology next to their name. I want the count to come out to 3 versus 7, since only 3 people have radiology in their name versus the amount of times their name come up.
    Attached Files Attached Files
    Last edited by adamsiskin; 08-15-2012 at 03:57 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Counting Unique Names based on Criteria

    Try:

    =COUNT(1/FREQUENCY(IF($B$2:$B$12=A16,IF($A$2:$A$12<>"",MATCH($A$2:$A$12,$A$2:$A$12,0))),ROW($A$2:$A$12)-ROW($A$2)+1))

    confirmed with CTRL+SHIFT+ENTER not just ENTER and copy down.

    Note: the Adam in A4 has an extra space in it.. remove it for more accurate result.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    06-26-2012
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: Counting Unique Names based on Criteria

    That did not work

    ---------- Post added at 03:02 PM ---------- Previous post was at 03:02 PM ----------

    oh wait it did

  4. #4
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Counting Unique Names based on Criteria

    Try this regular formula...(after removing the extra space after the name in A4 "adam ")
    Please Login or Register  to view this content.
    Copy that formula into B17

    Is that something you can work with?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  5. #5
    Registered User
    Join Date
    06-26-2012
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: Counting Unique Names based on Criteria

    The actual worksheet I am using is coming from different worksheets. I noticed that your formula has blank cells in it "_". Is there a way we can make the formula simplified like the newer one provided without referencing the blank cells?

    ---------- Post added at 03:26 PM ---------- Previous post was at 03:24 PM ----------

    If I had to do the calculation on another page, I need the formula to work

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Counting Unique Names based on Criteria

    Which of us are you talking too specifically? and what blank cells do you mean?

  7. #7
    Registered User
    Join Date
    06-26-2012
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: Counting Unique Names based on Criteria

    I was referring to Ron. NBVC your formula works when I apply it to one person, however, when I tried to copy it to 50 ppl excel bugged out and froze on me since I have a lot of data.

  8. #8
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Counting Unique Names based on Criteria

    I am not sure if Ron's would be much more efficient, as it really is an array formula in disguise....

    Perhaps using a helper column...

    e.g. in C2:

    =B2&"_"&(COUNTIFS(A$2:A2,A2,B$2:B2,B2)=1)

    copied down

    then B16:

    =COUNTIF($C$2:$C$12,A16&"_TRUE")

    copied down

+ 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