Count number of Occurrences

Anonnymouse

New Member
Joined
Jun 28, 2023
Messages
21
Office Version
  1. 365
Platform
  1. Windows
Hello Excel Experts,

I am not sure if this is possible but Im wondering if I can sort a list based on the number of times a value shows up in the column from largest to smallest.

Like on cell G4 it pastes it in order.

Thank you for the help!

ABCDEFGHIJKLMNOPQRSTUVWX
3TotalIdentifierSerial Number
45057Red15995057Red15991232Green987931Yellow111102962Blue1000805Brown9783892Orange5581
52962Blue1000457Red1599537Green987383Yellow11110477Blue1000618Brown8853297Orange9783
61232Green987373Red1599530Green987381Yellow11110374Blue1000296Brown8853
7931Yellow11110369Red1599517Green987322Yellow11110280Blue1000
8892Orange5581339Red1599487Green987300Yellow11110
9805Brown9783294Red1599377Green987
10618Brown8853293Red1599
11537Green987285Red1599
12530Green987283Red1599
13517Green987775036802317409317191189
14487Green987
15477Blue1000
16457Red1599
17398Violet5581
18383Yellow11110
19381Yellow11110
20377Green987
21374Blue1000
22373Red1599
23369Red1599
24339Red1599
25322Yellow11110
26300Yellow11110
27297Orange9783
28296Brown8853
29294Red1599
30293Red1599
31285Red1599
32283Red1599
33280Blue1000
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
How about
Fluff.xlsm
ABCDEFGHIJKLMNOPQRSTUVWXYZ
1
2
3TotalIdentifierSerial Number
45057Red15995057Red15991232Green987931Yellow111102962Blue1000805Brown9783892Orange5581398Violet5581
52962Blue1000457Red1599537Green987383Yellow11110477Blue1000618Brown8853297Orange9783
61232Green987373Red1599530Green987381Yellow11110374Blue1000296Brown8853
7931Yellow11110369Red1599517Green987322Yellow11110280Blue1000
8892Orange5581339Red1599487Green987300Yellow11110
9805Brown9783294Red1599377Green987
10618Brown8853293Red1599
11537Green987285Red1599
12530Green987283Red1599
13517Green987775036802317409317191189398
14487Green987
15477Blue1000
16457Red1599
17398Violet5581
18383Yellow11110
19381Yellow11110
20377Green987
21374Blue1000
22373Red1599
23369Red1599
24339Red1599
25322Yellow11110
26300Yellow11110
27297Orange9783
28296Brown8853
29294Red1599
30293Red1599
31285Red1599
32283Red1599
33280Blue1000
34
Sheet4
Cell Formulas
RangeFormula
F4:Z13F4=LET(u,UNIQUE(C4:C33),co,COUNTIFS(C4:C33,u),DROP(REDUCE("",SORTBY(u,co,-1),LAMBDA(x,y,HSTACK(x,VSTACK(EXPAND(SORT(FILTER(B4:D33,C4:C33=y),,-1),MAX(co),,""),EXPAND(SUMIFS(B:B,C:C,y),,3,""))))),,1))
Dynamic array formulas.
 
Upvote 0
Hey Fluffy thank you for the help! This worked although when i try to use a bigger dataset 1000000 cells it does not calculate? is it because its going horizontal?
 
Upvote 0
Do you really have 1 million rows of data?
 
Upvote 0
Do you have that many rows of data?
 
Upvote 0
Do you have that many rows of data?
Hey Fluff,

Yeah I have about 100k not sure if it would help the formula if it just pulls the top 50 colors and show how many times they populate on the list.
 
Upvote 0
Ok, try
Excel Formula:
=LET(u,UNIQUE(FILTER(C4:C100000,C4:C100000<>"")),co,COUNTIFS(C:C,u),DROP(REDUCE("",TAKE(SORTBY(u,co,-1),50),LAMBDA(x,y,HSTACK(x,VSTACK(EXPAND(SORT(FILTER(B4:D100000,C4:C100000=y),,-1),MAX(co),,""),EXPAND(SUMIFS(B:B,C:C,y),,3,""))))),,1))
 
Upvote 1
Solution
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,176
Messages
6,123,464
Members
449,100
Latest member
sktz

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