## How to sort data by the most frequent value in Excel?

Supposing you have a long list of data in your worksheet, and now you would like to sort this list by the frequency of which each word occurs. That is to say, the most common value (for example, occurs four times in the column) is listed first, and then be followed by the words which occur three times, twice and once as following screenshots shown. How could you solve this task in Excel?

#### Sort data by the most frequent value with a helper column

In Excel, there is no direct function for you to sort the data by frequency of occurrence at once, you need to count the occurrence of the values first, and then apply sort function in Excel.

1. Select a blank cell beside original column, and enter this formula =COUNTIF(\$A\$2:\$A\$16,A2) into it, and then drag this cell's AutoFill Handle down to the range as you need. See screenshot:

Note: In the above formula, A2:A16 is the specified list where you will sort by frequency, and A2 is the first data of this list.

2. Keep selecting these formula cells, and click Data > Sort A to Z or Sort Z to A as you need. See screenshot below:

3. In the opening Sort Warning dialog box, please check the Expand the selection option, and click the Sort button. See screenshot above:

4. And now the original column has been sorted by the frequency already (see below screenshot). If necessary, please delete the added helper column.

#### Sort data by the most frequent value with Kutools for Excel

Actually, Kutools for Excel provides an directly workaround to sort any list/column by the frequency easily with the Advanced Sort utility. Please do as follows:

Kutools for Excel - Packed with over 300 essential tools for Excel. Enjoy a full-featured 30-day FREE trial with no credit card required! Download now!

1. Select the list you need to sort by frequency, and click Kutools Plus > Sort > Advanced Sort. See screenshot:

2. In the popping up Advanced Sort dialog, please select the column which you will sort by frequency, choose Frequency from the Sort On drop down list, specify the Order you want, and click the Ok button. See screenshot:

Kutools for Excel's Advanced Sort utility provides us with much more flexible sorting methods: sort by text length, sort by last name, sort by absolute value, etc. Click to know more...

Kutools for Excel - Supercharge Excel with over 300 essential tools. Enjoy a full-featured 30-day FREE trial with no credit card required! Get It Now

#### Quickly find the most frequent text value or number in Excel

Generally, we can apply the MODE function to find the most frequent number in Excel. But how to get the most frequent text value from the specified range? Kutools for Excel’s Find most common value formula provides an easy way for you!

Kutools for Excel - Supercharge Excel with over 300 essential tools. Enjoy a full-featured 30-day FREE trial with no credit card required! Get It Now

### Best Office Productivity Tools

 🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions… Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ... Super Lookup: Multiple Criteria VLookup  |   Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup .... Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List .... Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ... Featured Features: Grid Focus   |  Design View   |   Big Formula Bar   |  Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells   |  Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ... Top 15 Toolsets:  12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...

#### Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

• Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
• Open and create multiple documents in new tabs of the same window, rather than in new windows.
• Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Hi there,

I am trying to sort the contents of an excel table in terms of the maximum number of "Yes" values that each row has in columns F to M of the table.

For example if row 36 has "Yes" in B, C, D, E and F (let us simplify and say this is the maximum number of "Yes" values), then row 36 should be at the top. If row 2 has "Yes" values in only B, D and E, then it should come after row 36: row 36 has 5 "Yes" values, row 2 has 3.

How do I do this? I am using excel on a mac, if that makes a difference. Thanks very much!!
This comment was minimized by the moderator on the site
Hi All

In this solution after getting occurrence ,rest of the sorting i want to do with excel 2016 formula

can anyone help me ...how we can sort with using 2016 version formula only
This comment was minimized by the moderator on the site
Hello, singh,
If you want to use a formula to sort the data, you can use the Sort function, but, this function is only available for Excel 365 and later versions.
=SORT(array, [sort_index], [sort_order], [by_col])

To get more detaied information of this function, the below article can help you!
https://www.extendoffice.com/excel/functions/excel-sort-function.html

Please have a try, thank you!
This comment was minimized by the moderator on the site
Not sure if my comment ever went through but I just figured out my goof! Thank you so much for posting this, it's exactly what I was looking for!!
This comment was minimized by the moderator on the site
Just what I was looking for! I'm just having a little trouble with it still because my list is first and last names and it's only looking at the first word. So for example, if the first 10 names were "Taylor Swift", it's including "Taylor Morrisen" in the count. I'm still working on figuring it out but definitely worth including in this article! Thanks for posting (:
This comment was minimized by the moderator on the site
DOES NOT WORK FOR ME!!!!!!!!!!!!!!!!!!!! If I give the =COUNTIF(\$A\$2:\$A\$15,"="&\$A2) - it does not count the values for me, but instead, it only writes the count of the data which is in the field A2!
This comment was minimized by the moderator on the site
Remove a dollar sign on A2
This comment was minimized by the moderator on the site
Hi Vipera, That may happen if you've got the "\$" symbol in the wrong place. To make sure you have it correct, type in the cell number (eg E2) and then press "F4" until the \$ symbol is in the correct place. Alternatively, as you are only copying the formula down one column, you can leave the second cell number without the \$ symbol and it should still work fine.
There are no comments posted here yet