Count Number of Times Values appear in a Column and Rank top 3

uk747

Well-known Member
Joined
Jul 20, 2011
Messages
843
Office Version
  1. 365
Platform
  1. Windows
Hi I have Data below

What I need to do is count the values in Column A and Show the top 3 where column B has abc

In Example below In Column A Tom appears 4 times, **** 3, harry 2 and mary 6 however i only want it to count where column B is abc

So Tom is 1, **** is 3, harry is 2 and mary 0

so end result in F2 would be:
F G
**** 3
harry 2
tom 1


AB
1​
tomabc
2​
****abc
3​
harryabc
4​
mary
5​
tom
6​
****abc
7​
harryabc
8​
mary
9​
mary
10​
mary
11​
mary
12​
mary
13​
tom
14​
tom
15​
****abc
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
How about
Fluff.xlsm
ABCDE
1AB
2tomabcRich3
3Richabcharry2
4harryabctom1
5mary
6tom
7Richabc
8harryabc
9mary
10mary
11mary
12mary
13mary
14tom
15tom
16Richabc
17
Sheet4
Cell Formulas
RangeFormula
D2:E4D2=LET(u,UNIQUE(FILTER(A2:A100,B2:B100="abc")),SORT(HSTACK(u,COUNTIFS(A:A,u,B:B,"abc")),2,-1))
Dynamic array formulas.
 
Upvote 0
Thanks Fluff just noticed one thing when i went to proper data, if Column A has Blanks in it and Column B has abc it will show

Is it a quick fix for it to ignore where blanks in column A and only count the actual names


****
2​
tom
1​
harry
1​
0​
0​
 
Upvote 0
How about
Excel Formula:
=LET(u,UNIQUE(FILTER(A2:A100,(B2:B100="abc")*(A2:A100<>""))),SORT(HSTACK(u,COUNTIFS(A:A,u,B:B,"abc")),2,-1))
 
Upvote 0
Solution
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,224,802
Messages
6,181,054
Members
453,014
Latest member
Chris258

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