+ Reply to Thread
Results 1 to 14 of 14

Count each unique value and it's occurrences

  1. #1
    Forum Contributor
    Join Date
    06-18-2010
    Location
    London
    MS-Off Ver
    Excel 365
    Posts
    139

    Question Count each unique value and it's occurrences

    Hi guys,

    I have a the following dilemma:

    A1
    tom
    harry
    charlie
    jones
    charlie
    charlie
    sam
    tom
    tom
    sam


    With the above in mind, do you know how I can count each unique value and the subsequent occurrences in a given column?

    So, the output would be something like:
    tom 3
    sam 2
    charlie 3
    jones 1


    Thanks!

    Z
    Last edited by zudecke; 01-31-2018 at 09:35 AM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,521

    Re: Count each unique value and it's occurrences

    I'd use a Pivot Table. But there are formulae to extract unique entries from a list. Then you'd use COUNTIF to get the numbers.

    See this thread for an example of extracting a list: https://www.excelforum.com/excel-for...p-10-list.html

    The post from Glenn Kennedy has a sample workbook.

    In your case, you could put this formula in cell D2 and copy it down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Then, in E2, use:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert
    Join Date
    12-09-2014
    Location
    Trakai, Lithuania
    MS-Off Ver
    2016
    Posts
    1,418

    Re: Count each unique value and it's occurrences

    unique
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    count each
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,521

    Re: Count each unique value and it's occurrences

    @Czeslaw: I think I said exactly that a little while back ...

  5. #5
    Forum Contributor
    Join Date
    06-18-2010
    Location
    London
    MS-Off Ver
    Excel 365
    Posts
    139

    Re: Count each unique value and it's occurrences

    Hi both,

    Thanks so much for your responses haha.

    I don't get what column Ds involvement is in this though?

    Thanks

    Z

  6. #6
    Forum Expert
    Join Date
    10-02-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    1,222

    Re: Count each unique value and it's occurrences

    If your data isnt dynamic just copy your list to another range/sheet, use remove duplicates, then use the COUNTIF formula as others have given.
    Ways to get help: Post clear questions, explain your overall goal, supply as much background as possible, respond to questions asked of you by those trying to help and post sample(s) files.

    "I am here to help, not do it for people" -Me

  7. #7
    Forum Contributor
    Join Date
    06-18-2010
    Location
    London
    MS-Off Ver
    Excel 365
    Posts
    139

    Re: Count each unique value and it's occurrences

    I've coped the range to a new sheet but tis isn't working:

    =IFERROR(INDEX($A$2:$A$11,MATCH(0,INDEX(COUNTIF($D$1:D1,$A$2:$A$11),),)),"")


    Nor am I sure how it should work? I don't know where the concept of column D came from? In this instance I just have 1 column (A)

  8. #8
    Forum Contributor
    Join Date
    06-18-2010
    Location
    London
    MS-Off Ver
    Excel 365
    Posts
    139

    Re: Count each unique value and it's occurrences

    For example, I've attached a sheet with a random list of values.

    Underneath, or wherever, I'd like each value listed, alongside the count of occurrences against each?

    Sorry, I'm having a hard time explaining it
    Attached Files Attached Files

  9. #9
    Forum Expert
    Join Date
    10-02-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    1,222

    Re: Count each unique value and it's occurrences

    See attached.

    Copied your list to other column, Data | remove duplicates, added COUNTIF formula, done. Took me about 30 seconds.
    Attached Files Attached Files

  10. #10
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,521

    Re: Count each unique value and it's occurrences

    Put this in cell B2 and copy it down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    and this in C2 and copy down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  11. #11
    Forum Expert
    Join Date
    12-09-2014
    Location
    Trakai, Lithuania
    MS-Off Ver
    2016
    Posts
    1,418

    Re: Count each unique value and it's occurrences

    @TMS:excuse me
    Exact match.

  12. #12
    Forum Contributor
    Join Date
    06-18-2010
    Location
    London
    MS-Off Ver
    Excel 365
    Posts
    139

    Re: Count each unique value and it's occurrences

    Thank you so much @TMS and everybody else - really a great help!

  13. #13
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,521

    Re: Count each unique value and it's occurrences

    You're welcome.



    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

  14. #14
    Forum Contributor
    Join Date
    06-18-2010
    Location
    London
    MS-Off Ver
    Excel 365
    Posts
    139

    Re: Count each unique value and it's occurrences

    Done, thanks again! Life savers and a credit to the community and society in general!

+ 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. Replies: 19
    Last Post: 05-29-2014, 04:49 PM
  2. Count unique occurrences, segmented by two columns
    By brendanyoung in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-22-2013, 03:28 PM
  3. Count unique occurrences with sumproduct
    By dana26 in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 02-03-2013, 11:55 PM
  4. Count unique occurrences of dates within period
    By areynolds in forum Excel General
    Replies: 6
    Last Post: 10-26-2011, 01:31 PM
  5. Replies: 4
    Last Post: 07-20-2011, 09:20 AM
  6. Count unique occurrences with criteria
    By Alaina Readman in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-01-2007, 04:41 PM
  7. [SOLVED] Count unique occurrences of name
    By jhicsupt in forum Excel General
    Replies: 4
    Last Post: 10-05-2005, 01:05 PM

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