Create a top 10 list based on multiple criterias sorted by summed values

testytest

New Member
Joined
Oct 12, 2023
Messages
2
Office Version
  1. 2019
Platform
  1. Windows
Hi All ! I have a very large data set that I want to create a top 10 list of. For example in the data below, I want to sort by say highest Quantity sorted. I know I can do this in a pivot table but I'd like to refrain from doing that if i can just write out a formula so i don't need to keep refreshing the pivot table

so for example, I would like the output to be:
top ten product Sold (product Name) and then the sum of the Quantity of that said product. this is the output i would like to see below, and below that is the example table TIA!!!!

NameDollarsQuantity
1​
A
21​
5491​
2​
G
124​
950​
3​
B
35​
589​





Prodcut NameDateDollarsQuantity
ASeptember
5​
15​
BOctober
10​
1​
CJanuary
12​
5​
DSeptember
1​
11​
EOctober
15​
115​
FJanuary
151​
GSeptember
1​
515​
HOctober
1​
15​
IJanuary
123​
435​
JSeptember
1​
134​
KOctober
5​
52​
KJanuary
15​
45​
ASeptember
1​
5422​
KOctober
16​
544​
AJanuary
15​
54​
BSeptember
10​
54​
BOctober
15​
534​
CJanuary
16​
5​
DFebruary
16​
45​
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Welcome to the MrExcel board!

Looks like your results are not drawn just from the sample data shown. With your Excel version, I would use some helper columns (G:I for me) which could be hidden if you want.

23 10 13.xlsm
ABCDEFGHI
1NameDollarsQuantity
21A215491
32K36641
43B35589
54G1515
6
7
8
9
10Prodcut NameDateDollarsQuantity
11ASeptember515A215491
12BOctober101B35589
13CJanuary125C2810
14DSeptember111D1756
15EOctober15115E15115
16FJanuary151F0151
17GSeptember1515G1515
18HOctober115H115
19IJanuary123435I123435
20JSeptember1134J1134
21KOctober552K36641
22KJanuary1545   
23ASeptember15422   
24KOctober16544   
25AJanuary1554   
26BSeptember1054   
27BOctober15534   
28CJanuary165   
29DFebruary1645   
Top n
Cell Formulas
RangeFormula
B2:C5B2=INDEX(G:G,AGGREGATE(15,6,ROW($I$11:$I$100)/($I$11:$I$100=$D2),COUNTIF($D$2:$D2,$D2)))
D2:D5D2=AGGREGATE(14,6,I$11:I$100,A2)
G11:G29G11=IFERROR(INDEX($A$11:$A$100,MATCH(0,INDEX(COUNTIF($G$10:G10,$A$11:$A$100)+(A$11:A$100=""),0),0)),"")
H11:I29H11=IF($G11="","",SUMIF($A$11:$A$100,$G11,C$11:C$100))
 
Upvote 0
Alternative solution with Power Query

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Grouped Rows" = Table.Group(Source, {"Prodcut Name"}, {{"Qty", each List.Sum([Quantity]), type number}, {"Total $", each List.Sum([Dollars]), type nullable number}})
in
    #"Grouped Rows"
 
Upvote 0
Hi thanks for your replies, @Peter_SSs do you have to create a helper table for this? there's over 600K rows of data and may not seem feasible.
 
Upvote 0
Hi thanks for your replies, @Peter_SSs do you have to create a helper table for this? there's over 600K rows of data and may not seem feasible.
Especially with your version of Excel I don't see a feasible way without helpers.
  • Have you tried Alan's Power Query option?
  • Otherwise, your Pivot Table option may be the way to go.
 
Upvote 0

Forum statistics

Threads
1,223,908
Messages
6,175,306
Members
452,633
Latest member
DougMo

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