Dynamic Top N List with SUMIFS

Trepidatioussaurus

New Member
Joined
Oct 12, 2022
Messages
9
Office Version
  1. 2016
Platform
  1. Windows
Good day everyone,

I've searched several forums but couldn't find an answer to my question. Maybe it's not even possible in Excel but we'll see...


So, I've got my table with three columns Region, Shoe Size and Sales. What I want to achieve is to create a Top N list of shoe sizes and their corresponding sum of sales. For region A, this would be sizes 45 and 44. Should another region be selectet, also the Top 2 sizes might change, like 44 and 43 for region C:

Excelample.JPG


I was not able to set up this highly dynamic Top 2 list with my Excel version Professional Plus 2016.

A solution without using pivot table is what I would need.

Is this even possible?

Thanks in advance for your replies!

Kind regards
Stefan
 
How about
Fluff.xlsm
ABCDEFGHI
1RegionA
2
3MonthRegionShoe SizeSalesTop 4Shoe SizeSum Sales
4JanAX435351X4335
5FebAX4415152X4530
6MarAX4530303X4415
7MarAX4315 4X4610
8AprAX4315 
9MarAX461010
10JanBX441010
11FebBX431515
12AprCX431515
13MarCX442525
14JanDX452020
15FebEX461010
16JanEX4355
17FebFX421010
18
Main
Cell Formulas
RangeFormula
H4:H7H4=INDEX($C$4:$C$102,AGGREGATE(15,6,(ROW($C$4:$C$102)-ROW($C$4)+1)/($B$4:$B$102=$H$1)/($E$4:$E$102=I4),COUNTIFS(I$4:I4,I4)))
I4:I7I4=AGGREGATE(14,6,$E$4:$E$102/($B$4:$B$102=$H$1),ROWS(I$4:I4))
E4:E17E4=IF(COUNTIFS(C$4:C4,C4,B$4:B4,B4)=1,SUMIFS(D:D,B:B,B4,C:C,C4),"")
This works excellent! Thank you so much for your time!
 
Upvote 0

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.

Forum statistics

Threads
1,223,723
Messages
6,174,123
Members
452,546
Latest member
Rafafa

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