Ranking Groups and Members

Tarver

Board Regular
Joined
Nov 15, 2012
Messages
109
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
Hey, Excel experts!

Can you help me create a report similar to the one below? I'm trying to report the top 10 businesses, grouped by their channel.

Book1
ABC
1Club Channel
21Sam's Club$ 67,844,223
35Costo$ 176,719
4Big Box Channel
52Target$ 36,221,321
63Walmart$ 1,230,069
7Convenience Channel
84Starvin' Marvin$ 1,020,743
977-Eleven$ 92,829
109Little General$ 39,013
1110QuikTrip$ 24,536
12Grocery Channel
136Safeway$ 102,187
148Safeway$ 102,187
Sheet1


This report shows the top 10 buinesses. Note that the channels (Club, Big Box, etc.) are shown according to their rank (Big Box has highest sales,) and the individual business' ranking is displayed next to their name at left. The Pharmacy Channel doesn't appear on the report because none of its businesses are ranked in the top 10.

I have two tables that provide the data for this report.

The sales data table:
Book1
ABCD
1ChannelMerchantSalesRank
2Big BoxWalmart$ 1,230,0693
3ConvenienceStarvin' Marvin$ 1,020,7434
4Big BoxTarget$ 36,221,3212
5ConvenienceLittle General$ 39,0139
6Convenience7-Eleven$ 92,8298
7ConvenienceQuikTrip$ 24,53610
8ClubSam's Club$ 67,844,2231
9ClubCostco$ 176,7195
10ConvenienceCumberland Farms$ -17
11ClubBJ's Wholesale$ 12,31011
12PharmacyRite Aid$ 5,24013
13PharmacyWalgreen's$ 4,25015
14GrocerySafeway$ 102,1876
15PharmacyCVS Pharmacy$ 4,31514
16GroceryKroger$ 7,03312
17GroceryHEB$ 1,12516
18GrocerySafeway$ 102,1876
Sheet2


The channel rank table:
Book1
ABC
1ChannelSalesRank
2Big Box$ 37,451,3902
3Convenience$ 1,177,1213
4Club$ 68,033,2521
5Pharmacy$ 13,8055
6Grocery$ 212,5324
Sheet3


What's the best way to combine the data to produce the output I'm trying to achieve? I've gone down the road of trying to use dynamic array formulas on the sales data table, but I'm not having luck. My ideal solution will NOT use pivot tables or VBA code, though I'm open to those if there's no simpler way.

Thanks for your help!

(And by way of a disclaimer, the data above is not real data; it is for illustrative purposes only.)
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
If the following presentation works for you then, the solution is with power query and the Mcode follows.

Book1
FGHI
1ChannelMerchantSalesRank
2ClubSam's Club67844222.951
3ClubCostco176719.355
4Big BoxTarget36221320.722
5Big BoxWalmart1230069.193
6ConvenienceStarvin' Marvin1020743.154
7Convenience7-Eleven92828.748
8ConvenienceLittle General39012.869
9ConvenienceQuikTrip24535.8510
10GrocerySafeway102186.816
11GrocerySafeway102186.816
Sheet1


Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Channel", type text}, {"Merchant", type text}, {"Sales", type number}, {"Rank", Int64.Type}}),
    #"Sorted Rows" = Table.Sort(#"Changed Type",{{"Rank", Order.Ascending}}),
    #"Filtered Rows" = Table.SelectRows(#"Sorted Rows", each ([Rank] <> 11 and [Rank] <> 12 and [Rank] <> 13 and [Rank] <> 14 and [Rank] <> 15 and [Rank] <> 16 and [Rank] <> 17)),
    #"Grouped Rows" = Table.Group(#"Filtered Rows", {"Channel"}, {{"Data", each _, type table [Channel=nullable text, Merchant=nullable text, Sales=nullable number, Rank=nullable number]}}),
    #"Expanded Data" = Table.ExpandTableColumn(#"Grouped Rows", "Data", {"Merchant", "Sales", "Rank"}, {"Merchant", "Sales", "Rank"})
in
    #"Expanded Data"
 
Upvote 0

Forum statistics

Threads
1,214,788
Messages
6,121,600
Members
449,038
Latest member
Arbind kumar

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