+ Reply to Thread
Results 1 to 5 of 5

Sort by the Frequency

  1. #1
    Registered User
    Join Date
    05-18-2012
    Location
    Norwalk, CT
    MS-Off Ver
    Excel 2010
    Posts
    80

    Sort by the Frequency

    Hi,

    I want to sort column A by most frequent number to least frequent number without losing data integrity in the rows.

    I want all the 4's to appear first because there are 100+ of them in column A. I want all the 5's to appear 2nd because there are 70+ of them...and so on. You do not know that 4 and 5 are the most frequent numbers though.

    I also want to avoid using loops in this code.

    SortByFrequency.xlsx
    Last edited by niko79542; 07-23-2012 at 03:19 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Sort by the Frequency

    In E2 and copy down, =COUNTIF($A$2:$A$501, A2)

    Select all columns and sort by col E.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Sort by the Frequency

    in E2
    =COUNTIF(A$2:A$501,A2)
    and copy down

    then sort on column E
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  4. #4
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Sort by the Frequency

    Darn, same solution, just 3 mins too late :-(
    Never mind, great minds etc... :-)

  5. #5
    Registered User
    Join Date
    05-18-2012
    Location
    Norwalk, CT
    MS-Off Ver
    Excel 2010
    Posts
    80

    Re: Sort by the Frequency

    Yesssss...lifesavers!!

    Thx both of you

+ 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