+ Reply to Thread
Results 1 to 5 of 5

Sort data by word frequency

  1. #1
    Registered User
    Join Date
    06-25-2017
    Location
    Australia
    MS-Off Ver
    365
    Posts
    76

    Sort data by word frequency

    I've tried googling this, but I don't think I'm using the right keywords.

    I have the following data:

    Red 1
    Blue 1
    Blue 2
    Green 1
    Green 2
    Green 3
    White 1
    White 2
    White 3
    White 4

    What I need to do is sort the data that results in the most frequently used word at the top.

    Like so:

    White 1
    White 2
    White 3
    White 4
    Green 1
    Green 2
    Green 3
    Blue 1
    Blue 2
    Red 1

    Basically, "White" has the highest count of usage (four times), so those rows that feature "White" are put at the top. There are three instances of "Green", so it's next down the list. Then there's two Blue... and finally Red is at the bottom, because it's only used once.

    Can Excel do such a thing?

    I'm thinking maybe a formula that places the total count next to each color, and then using Excel's inbuilt SORT ability accordingly. Unless there's some quicker/easier way?

    Sorry if I'm explaining it badly. It actually took several tries to type this up in a way that makes sense.
    Last edited by 2vbr; 08-05-2020 at 12:05 PM.

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: Sort data by word frequency

    Yes, easiest way is to add helper column.
    Using =COUNTIF($A$2:$A$11,A2)

    Then sort by helper, desc and Count, asc.
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Sort data by word frequency

    If you add a ranking column, you can use this when you set up the sort on three columns.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  4. #4
    Registered User
    Join Date
    06-25-2017
    Location
    Australia
    MS-Off Ver
    365
    Posts
    76

    Re: Sort data by word frequency

    Thanks for the help!

    Both methods worked, so I'll play around with both some more too see which comes more naturally.

    Completely unrelated question, but one I've been wondering for years: When locking cells with the $ modifier, is it possible to do it with the mouse?

    When selecting large columns, I usually click a cell and then use SHIFT+CTRL+DOWN ARROW to select the entire column of data. But that would only give me A1:A200. If I wanted $A$1:$A$200, I need to manually type it in. Are there any alternatives using the mouse or combo keys?

    EDIT: Never mind! I finally found the magic google keywords!

    ANSWER: Press F4 after selecting the range.
    Last edited by 2vbr; 08-05-2020 at 12:17 PM.

  5. #5
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: Sort data by word frequency

    You are welcome and thanks for the rep

+ 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] vba to sort by frequency
    By reveleth in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-07-2017, 09:06 PM
  2. [SOLVED] Sort by the Frequency
    By niko79542 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-23-2012, 03:24 PM
  3. Using Count/Frequency/Binning to sort data
    By Jarvice in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-14-2012, 06:28 AM
  4. Sort by frequency?
    By Test5000 in forum Excel General
    Replies: 6
    Last Post: 04-09-2011, 02:47 PM
  5. Plotting the frequency of a word (no-numerical data)
    By nbn22385 in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 08-03-2007, 07:29 PM
  6. word frequency
    By pouch in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-24-2006, 08:00 AM
  7. Sort Data by Frequency
    By Susan Smith in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-25-2005, 01:06 AM

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