Sorting Numbers Based on their Frequency within a List

In this article, we will learn how to sort the numbers based on their frequency in the range.

We use Frequency to know how often a value is repeating in a range.

To understand the way to sort number based on their frequency within a list, we will take 2 Examples.

Example 1

Let’s take an example and understand how we can sort the data on the basis of frequency.

We have an agent data with number of sales. We want to sort the data as per their frequency of sales number.

 

image 1

 

First we will return the frequency of the numbers, follow below steps:-

  • In cell C2 EnterCOUNTIF function.
  • =COUNTIF($B$2:$B$24,B2), press enter
  • And copy the same formula in the range C2:C24.

 

image 2

 

To sort the data as per the frequency.

  • Select the data A1:C24.
  • Go to Data tab > Click on Sort option.
  • Sort dialog box will appear.
  • From the Sort by option> Select Frequency.

 

image 3

 

  • In Sort on option > select values.
  • In order > Largest to smallest.

 

image 4

 

  • Click on ok.

 

image 5

 

Example 2

Now we have product list, in which we want to see that which product is selling more through agents.

image 6

First we will return the frequency of product:-

  • Enter the formula in Cell D2.
  • =COUNTIF($A$2:$A$24,A2)
  • Copy the formula in the range D3:D24

 

image 7

 

We will sort the data according to the frequency of the product. Follow below steps:-

  • Select the data range.
  • Go to Data tab > Sort option.
  • Sort dialog box will appear.
  • In the sort by, select Frequency of product.

 

image 8

 

  • In the sort on option > select values.
  • In the order option > select largest to smallest.

 

image 9

 

  • Click on ok.

 

image 10

 

Conclusion: -In Excel, we can sort data in any of the ways provided that our requirement is clear.

Taken away points:-

  • Sort data according to the frequency of number.
  • Sort data according to the frequency of text.

image 29

 

If you liked our blogs, share it with your friends on Facebook. And also you can follow us on Twitter and Facebook.
We would love to hear from you, do let us know how we can improve, complement or innovate our work and make it better for you. Write us at info@exceltip.com

Leave a Reply

Your email address will not be published. Required fields are marked *

Terms and Conditions of use

The applications/code on this site are distributed as is and without warranties or liability. In no event shall the owner of the copyrights, or the authors of the applications/code be liable for any loss of profit, any problems or any damage resulting from the use or evaluation of the applications/code.