Top Ten formula that sorts duplicates & excludes results with "0".

Parebody

New Member
Joined
Jan 4, 2018
Messages
43
Office Version
  1. 2016
Platform
  1. Windows
Looking for guidance. I am trying to set up my formula's in D3:E12 to list only the top ten (or less) quantities from column B, with their associated reject codes from column A. However, I want to include duplicate quantities with different codes, and I want to exclude codes that show no results (zero). I would also like any cells in column's D and E that are less then "1" to appear blank. Any help would be appreciated!

UPDATE: I forgot. Here's the formula in column D cells: =INDEX($A$2:$A$32,MATCH($E$3:$E$12,$B$2:$B$32,0)). And here's the formula in column E cells: {=LARGE(B2:B32,{1;2;3;4;5;6;7;8;9;10}).

1604008029151.png
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
What version of Excel are you using?
Please update your account details to show this, as it affects which functions you can use.
 
Upvote 0
Let's get the ball rolling. Now I had to make some changes to accommodate if there is a code with the same total. Usually this generates more questions than answers so let the discussion begin.


20-10-29 rank.xlsx
ABCDEFGH
1Reject CodeTotalTop 10 Reject CodesNumber above 0
2A116Reject CodeTotal8
3A2016A1
4A3012BG
5A6010BR
6A8010SA
7A906EY
8AV04BV
9AZ04BX
10B203DG
11B30  
12B40  
13B50
14BC0
15BE0
16BG12
17BI0
18BK0
19BR10
20BS0
21BT0
22BU0
23BV4
24BX4
25EX0
26EY6
27DE0
28DF0
29DG3
30SA10
31CA0
32CB0
Code top 10
Cell Formulas
RangeFormula
G2G2=COUNTIF(B2:B32,">0")
D3:D12D3=IF(LARGE($B$2:$B$32,ROWS($C$3:C3))>1,LARGE($B$2:$B$32,ROWS($C$3:C3)),"")
E3:E12E3=IF(D3<>"",INDEX($A$2:$A$32,AGGREGATE(15,6,(ROW($C$2:$C$32)-ROW($C$2)+1)/($B$2:$B$32=D3),COUNTIF($D$3:D3,D3))),"")
 
Upvote 0
Solution
Microsoft Excel 2016
Thanks for that, please don't forget to update your account details & then scroll down & click save. It saves members having to ask. ;)

Another option
+Fluff v2.xlsm
ABCDE
1
2A116
3A20A623
4A30A1919
5A48A116
6A57A716
7A623A1012
8A716A48
9A80A57
10A90A145
11A1012A124
12A110  
13A124
14A130
15A145
16A150
17A160
18A170
19A180
20A1919
21A200
22
23
Work
Cell Formulas
RangeFormula
A2:A21A2="A"&SEQUENCE(20)
D3:D12D3=IF(E3="","",INDEX($A$2:$A$32,AGGREGATE(15,6,(ROW($A$2:$A$32)-ROW($A$2)+1)/($B$2:$B$32=E3),COUNTIF(E$3:E3,E3))))
E3:E12E3=IFERROR(AGGREGATE(14,6,$B$2:$B$32/($B$2:$B$32>0),ROWS(E$3:E3)),"")
Dynamic array formulas.
 
Upvote 0
ezguy4u, your suggestion worked perfectly! Amazing. I watched a video on this showing how to add the countif formula and the aggregate function but could not get it to work. 2nd option works great too if I need to sequencing. Thank you ezguy4u and Fluff for your insight. This information has been a huge help! Love learning new stuff in Excel!!!
 
Upvote 0

Forum statistics

Threads
1,214,952
Messages
6,122,457
Members
449,083
Latest member
Ava19

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