+ Reply to Thread
Results 1 to 5 of 5

Count the number of unique values (occurances) in a range.

  1. #1
    Registered User
    Join Date
    12-13-2013
    Location
    Texas
    MS-Off Ver
    Excel 2007
    Posts
    15

    Count the number of unique values (occurances) in a range.

    I'm hoping this is an easy one. I just need to count the number of unique county names in a column. I'd like to do it without a helper column. Possible?

    CountyName
    Henry (1)
    Jefferson (2)
    Winston (3)
    Jefferson (2)
    Hale (4)
    Shelby (5)
    Marshall (6)
    Tallapoosa (7)
    Calhoun (8)
    Pickens (9)
    Talladega (10)
    Etowah (11)
    Covington (12)
    Lauderdale (13)
    Calhoun (8)
    13 <-- Should be the result, because there are only 13 unique names.

  2. #2
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Count the number of unique values (occurances) in a range.

    Assuming data in Column A2:A30 range

    =SUMPRODUCT((A2:A30<>"")/COUNTIF(A2:A30,A2:A30&""))
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  3. #3
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.95 for Mac MS 365
    Posts
    8,690

    Re: Count the number of unique values (occurances) in a range.

    you'll need to put the results somewhere obviously.
    if the county names are in col A then this should work...
    =countif(A1:A15,A1) in col B and it'll give you the results.

    EDIT: now that i reread your post for the 5th time, I misunderstood what you wanted. And Alkey's post helped me see it.
    His response is better than mine.
    Last edited by Sam Capricci; 12-13-2013 at 10:29 AM.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  4. #4
    Registered User
    Join Date
    12-13-2013
    Location
    Texas
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Count the number of unique values (occurances) in a range.

    This works. Thank you!

    Quote Originally Posted by AlKey View Post
    Assuming data in Column A2:A30 range

    =SUMPRODUCT((A2:A30<>"")/COUNTIF(A2:A30,A2:A30&""))

  5. #5
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Count the number of unique values (occurances) in a range.

    Thank you for the feedback! Please mark thread as "Solved" if your issue has been resolved. (Selecting Thread Tools-> Mark thread as Solved).

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Count number of occurances below a range, within a range, and below a range
    By maacmaac in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-15-2013, 11:36 PM
  2. count occurances of range of numbers in unknown number of cells.
    By gammaman in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 10-12-2012, 06:27 AM
  3. Count the number of occurances of a value in a range.
    By pi**edasanewt in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-15-2008, 07:08 AM
  4. Count # of unique occurances
    By sharder in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-29-2006, 12:45 AM
  5. [SOLVED] count number of occurances of a word in a range
    By John Davies in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-24-2006, 09:50 AM

Tags for this Thread

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