+ Reply to Thread
Results 1 to 6 of 6

How to count frequency of items in the table (given 2 columns in a table)

  1. #1
    Registered User
    Join Date
    06-09-2006
    Posts
    62

    How to count frequency of items in the table (given 2 columns in a table)

    Hi all,

    This one is really bugging me. I have a list of 3000 items. The list has 2 columns: ID, STATUS

    Please Login or Register  to view this content.
    What I wish to do is to COUNT the frequency of the IDs. For example, ID 13 appears 6 times and ID 45 4 times). But when the list is so long it's really hard to SUM every ID.

    Thank you for any pointers.

  2. #2
    Registered User
    Join Date
    06-16-2010
    Location
    India, Pune-411006
    MS-Off Ver
    Excel 2007/2010
    Posts
    89

    Re: How to count frequency of items in the table (given 2 columns in a table)

    you can use COUNTIF formula.

    =COUNTIF(Range,Criteria)

    e.g. =COUNTIF(Col ID,13)

  3. #3
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: How to count frequency of items in the table (given 2 columns in a table)

    Hi xianwinwin
    you could use something like this from zbor...

    '{=IF(ISERROR(INDEX(A30:A58,SMALL(IF(IF(ISERROR(MATCH(A30:A58,A30:A58,0)),",MATCH(A30:A58,A30:A58,0))<>ROW(INDIRECT(1:"&ROWS(30:58))),"",IF(ISERROR(MATCH(A30:A58,A30:A58,0)),"",MATCH(A30:A58,A30:A58,0))),ROW(INDIRECT("1:"&ROWS(30:58)))))),"",INDEX(A30:A58,SMALL(IF(IF(ISERROR(MATCH(A30:A58,A30:A58,0)),"",MATCH(A30:A58,A30:A58,0))<>ROW(INDIRECT("1:"&ROWS(30:58))),"",IF(ISERROR(MATCH(A30:A58,A30:A58,0)),"",MATCH(A30:A58,A30:A58,0))),ROW(INDIRECT("1:"&ROWS(30:58))))))}
    to find all the unquie values and

    =SUMPRODUCT(--(A1:A13=A4))
    to count them
    Last edited by pike; 06-21-2010 at 07:25 PM. Reason: change formulae
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: How to count frequency of items in the table (given 2 columns in a table)

    pike i don't know what that's supposed to do but its got errors in it!
    if you wanted to list unique with a function try
    =INDEX($A$1:$A$350,MATCH(1,INDEX(($A$1:$A$350<>"")*ISNA(MATCH($A$1:$A$350,$C$1:C1,0)),0),0))
    with list in a1 down put this array formula in c2
    but this has no bearing on the op's question! which i think Ganesh7299 answered
    Last edited by martindwilson; 06-21-2010 at 07:55 PM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  5. #5
    Registered User
    Join Date
    06-09-2006
    Posts
    62

    Re: How to count frequency of items in the table (given 2 columns in a table)

    Thank you all.
    The proposed solution of Ganesh7299 will not work. Because I will have to write this method X time (X=number of unique IDs) I have something like ~150 unique ids so it will not work.

    I wish to write once and drag it down and get the result next to the unique ID. example:

    look at the imagehttp://img341.imageshack.us/img341/7...00621at851.png

    the result is on the left side.

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: How to count frequency of items in the table (given 2 columns in a table)

    to get similar to that but the result will be next to the last instance not the first drag this down
    =IF(COUNTIF($b$2:b2,b2)=COUNTIF(b:b,b2),COUNTIF($b$2:b2,b2),"")

+ 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