+ Reply to Thread
Results 1 to 11 of 11

Frequency in large data tables

  1. #1
    Registered User
    Join Date
    11-11-2009
    Location
    Denmark
    MS-Off Ver
    Excel 2003
    Posts
    2

    Frequency in large data tables

    Hi,
    I need to find the most frequent number for each name in a large datatable, eg. Name1=12.

    ColumnA / ColumnB
    Name1 / 12
    Name1 / 11
    Name1 / 12
    Name2 / 100
    Name2 / 105
    Name2 / 105
    Name2 / 98
    Name3 / 14
    Name3 / 14
    Name3 / 2
    NameX / ..

    Since Pivot tabels cant do the trick as far as I know, i'm clueless of how to proceed.

    Any help is appreciated, thanks!

  2. #2
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Frequency in large data tables

    Use a pivot, don't know why you think you can't.

    Put Name in row fields and Name in data area - will give count of name.

    CC

    EDIT

    The alternative is something like =countif(A:A,A1) copied down, but this lacks the "automatically assmeble a unique list of entries which a pivot table does in seconds...

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Frequency in large data tables

    Regards Pivot Table... you could perhaps add column @ source, eg:

    C1: =A1&":"&B1
    copied down for all rows

    Create the PT as follows:

    Column A as ROW FIELD
    Column C as ROW FIELD
    Column B as DATA FIELD set to Max
    Column C as DATA FIELD set to COUNT (using field twice)

    Now use Advanced Top 10 feature on 2nd ROW Field to display Top 1 Items based on Count of Column C, the MAX value field is your MODE.

  4. #4
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Frequency in large data tables

    Hey DO,

    I think you left your sledgehammer here, you'll have to come back for it, I can't pick it up...



  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Frequency in large data tables

    Not sure I follow CC.

    The OP isn't looking for Count of Names as implied in your initial response rather OP is looking for MODE per Name in tabular form.

    The PT approach I outlined is not expensive IMO far less so than Array based approach though if data is sorted it might not be too inefficient to setup - all depends on volume.

  6. #6
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191

    Re: Frequency in large data tables

    I agree that a pivot table is more efficient, particularly if you have a large dataset, but if you have restrictions on adding columns or tables for whatever reason, I'm just going to throw out a formula-based approach. With your table being from A1:B9, if you started listing the names individually at A11, B11 can have =MODE(IF($A$1:$A$9=A11,$B$1:$B$9)), confirmed with Ctrl+Shift+Enter. It will return an error if there is no mode.

  7. #7
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Frequency in large data tables

    As inferred earlier if the data is sorted you could circumvent the Array by using the MODE in conjunction with INDEX.

    =MODE(INDEX($A:$A,MATCH($A11,$A:$A,0)):INDEX($A:$A,MATCH($A11,$A:$A)))

    Dynamic extraction of the names themselves would however warrant a potentially expensive approach - how expensive would be determined by volume of data.

  8. #8
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Frequency in large data tables

    The OP isn't looking for Count of Names as implied in your initial response rather OP is looking for MODE per Name in tabular form.
    Oh...

    um...

    yeah...

    you're right

    ...


    ...


    sorry about that

  9. #9
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Frequency in large data tables

    Although... I would suggest it could be simplified:
    Name and Number to rows (in that order)
    Count of Number as Data Item.
    Autoshow top 1, by Count of Number, of Number row field
    - no need for additional source data field.

    CC

  10. #10
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Frequency in large data tables

    True. Good suggestion.

  11. #11
    Registered User
    Join Date
    11-11-2009
    Location
    Denmark
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Frequency in large data tables

    Thanks a lot for all the replies - Problem is solved...!!!

+ 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