Return the top 10 occurrences of an item in a table and the count of that item

Tipsey

New Member
Joined
Oct 28, 2022
Messages
17
Office Version
  1. 365
Platform
  1. Windows
Hello everyone,

I have a data table that I would like to use a filter function on. I would like to filter out and show the 10 most frequent employee numbers that show up in the table, along with their name and how many times they were in the list. I am struggling to complete this formula.

=LARGE(COUNTIF(Table3[Emp '#],UNIQUE(Table3[Emp '#],FALSE,FALSE)),{1;2;3;4;5;6;7;8;9;10})

This is accurately returning the count of the top 10 employee numbers to show up, but I am having a hard time turning that around and finding out who was in the list 10 times etc.

=SORT(HSTACK(UNIQUE(FILTER(Table3[Emp '#],Table3[Emp '#]),FALSE,FALSE),XLOOKUP(UNIQUE(FILTER(Table3[Emp '#],Table3[Emp '#]),FALSE,FALSE),Table3[Emp '#],Table3[Emp Name]),COUNTIF(Table3[Emp '#],UNIQUE(FILTER(Table3[Emp '#],Table3[Emp '#]),FALSE,FALSE))),3,-1)

This grotesque formula gives me the entire list and sorts it, which isn't terrible, and I may use it, but I would like to be able to find just the top 10. Also if somebody has a cleaner way of creating that second formula I would be interested in seeing that too.

Thanks in advance for any help you can provide and for taking the time to do so.

Cheers
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
How about
Excel Formula:
=LET(u,UNIQUE(Table3[Emp '#]),TAKE(SORTBY(u,COUNTIFS(Table3[Emp '#],u),-1),10))
 
Upvote 1
Solution
My two favorite words to read after posting a question on here.

Thank you very much for the response, and frankly all of the responses to everyone's inquiries.
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,069
Messages
6,122,958
Members
449,096
Latest member
Anshu121

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