FORMULA TO ARRANGE VALUES IN DECENDING ORDER ACORDING TO THE FREQUENCY OF OCCURANCES

Analytic

New Member
Joined
Oct 31, 2015
Messages
16
Office Version
  1. 2019
Platform
  1. Windows
Hi I would like to request for help,

The problem is that , there are some values in coloumn A , whereas the soluton is to find a folrmula to arrange those values in decending order according to their frequency in coloumn B.

Please note there are some blank cells in coloumn A.

A B
1 4
1 1
1 2
2 5
2
4
4
4
4
5

In the above example , 4 has occured four times in coloumn A so it is in the first row in Coloumn B and also 1 has occured 3 times in Coloumn A so it is in the second row in coloumnB and so on.

Thanks
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Please update your current Excel version in your profile at the RIGHT TOP and here too

Your solution is totally dependent on the version of Excel you are currently using.
 
Upvote 0
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
Hi I would like to request for help,

The problem is that , there are some values in coloumn A , whereas the soluton is to find a folrmula to arrange those values in decending order according to their frequency in coloumn B.

Please note there are some blank cells in coloumn A.

A B
1 4
1 1
1 2
2 5
2
4
4
4
4
5

In the above example , 4 has occured four times in coloumn A so it is in the first row in Coloumn B and also 1 has occured 3 times in Coloumn A so it is in the second row in coloumnB and so on.

Thanks
I'am using windows 10 with office 2019 professional plus
 
Upvote 0
You could use Power Query.

Analytic.xlsb
IJ
1ATable6
214
311
412
525
62
74
84
94
104
115
Sheet7


Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Group = Table.Group(Source, {"A"}, {{"Count", each Table.RowCount(_), Int64.Type}}),
    Sort = Table.Sort(Group,{{"Count", Order.Descending}})[A]
in
    Sort
 
Upvote 0
You could use Power Query.

Analytic.xlsb
IJ
1ATable6
214
311
412
525
62
74
84
94
104
115
Sheet7


Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Group = Table.Group(Source, {"A"}, {{"Count", each Table.RowCount(_), Int64.Type}}),
    Sort = Table.Sort(Group,{{"Count", Order.Descending}})[A]
in
    Sort
Hi, i am kind of a new to power query , so can u please bit elaborate how to insert this code and how to run it in excel, thanks
 
Upvote 0
Whilst I can easily extract the distinct values, I struggling to sort them correctly.
 
Upvote 0
First step would be to load the data in Column A into the Power Query Editor. Data Tab -> Get & Transform Data -> Other Sources -> From Table/Range.

Once the table is loaded in you can go to the Home tab and click on Advanced Editor and paste the code I posted.

Then click Close and Load.
 
Upvote 0
How about:

Book1
AB
1ListBy Frequency
214
311
412
529
625
74 
84 
94
104
115
12
139
14
159
16
17
18
19
20
Sheet3
Cell Formulas
RangeFormula
B2:B8B2=IFERROR(MODE(IF(($A$2:$A$20<>"")*(COUNTIF($B$1:$B1,$A$2:$A$20)=0),$A$2:$A$20*{1,1},"")),"")
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Solution

Forum statistics

Threads
1,214,885
Messages
6,122,085
Members
449,064
Latest member
MattDRT

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top