+ Reply to Thread
Results 1 to 5 of 5

Counting Occurrences of Items in a List Based on Separate List Values

  1. #1
    Registered User
    Join Date
    05-09-2013
    Location
    Phoenix
    MS-Off Ver
    Excel 2010
    Posts
    4

    Counting Occurrences of Items in a List Based on Separate List Values

    I'm attempting to count repeating numbers in a list but only count them once for each occurrence.

    Here's an example.
    This is the source.

    Control # Category Description
    123456 12 unique text
    123456 12 unique text
    123456 12 unique text
    654321 14 unique text
    654321 14 unique text
    654321 14 unique text
    456789 16 unique text
    456789 16 unique text
    456789 16 unique text
    789123 14 unique text
    789123 14 unique text
    789123 14 unique text

    I need to count the number of unique category instances for each control number. The categories may occur several times but under different control numbers. The result should look like the table below but I'm stumped on how to achieve it with formulas.

    Categories Count
    12 1
    13 0
    14 2
    15 0
    16 1
    Last edited by wheel1; 05-09-2013 at 03:02 PM.

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,953

    Re: Counting Occurrences of Items in a List Based on Separate List Values

    See the attachment.

    I used an helpcolumn to get the result.
    Attached Files Attached Files
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,577

    Re: Counting Occurrences of Items in a List Based on Separate List Values

    Can control numbers appear in more than 1 category? If not, then using a dummy column
    In D2 copied down
    =IF(ISERROR(MATCH(A2, $A$1:A1,0)),1,0)

    Then in your table
    =SUMIF($B$2:$B$13,A16,$D$2:$D$13) copied down
    See attachment
    Attached Files Attached Files
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Registered User
    Join Date
    05-09-2013
    Location
    Phoenix
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Counting Occurrences of Items in a List Based on Separate List Values

    I think oeldere's solution will work best. There is a slim possiblity that a duplicate control number will occur but extremely unlikely that the category will be the same. Using a help column works in that scenario. I was trying to keep away from using a pivot table, but if that is what works so be it. Thanks to both of you for replying!

  5. #5
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,953

    Re: Counting Occurrences of Items in a List Based on Separate List Values

    Glad I could help.

    Thanks for the reply.

    If your question is solved, will you mark it solved (if not already done).

+ 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