Ranking categories based on total (summed up) values

kderoeck

New Member
Joined
Oct 24, 2012
Messages
6
Hi,

I'm looking for a formula (that can be used in an excel Table) that allows me to add a ranking on row level that is calculated on the total sales per category. This means that rows from the same category should all have the same ranking. An example of the Table and the desired result:

Category Month Sales Rank
AAA OCT2016 2000 3
AAA NOV2016 6000 3
AAA DEC2016 1000 3
BBB OCT2016 3000 1
BBB NOV2016 7000 1
BBB DEC2016 5000 1
CCC OCT2016 8000 2
CCC NOV2016 4000 2
CCC DEC2016 1000 2

Category AAA has total sales of 9000 (and ranks as 3rd),
Category BBB has total sales of 15000 (and ranks as 1st),
category CCC has total sales of 1300 (and ranks as 2nd).

To make things even more challenging, I'd like to be able to get to this result without the use of intermediate step/columns :)
 

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).
Maybe...

Formula in D2 copied down
=SUMPRODUCT(--(SUMIF($A$2:$A$10,$A$2:$A$10,$C$2:$C$10)>SUMIF($A$2:$A$10,A2,$C$2:$C$10)),--(MATCH($A$2:$A$10,$A$2:$A$10,0)=ROW($A$2:$A$10)-ROW($A$2)+1))+1

Hope this hels

M.
 
Upvote 0
Hi Marcelo,

This is just perfect! The formula you're suggesting does exactly what I wanted.
Many thanks for the prompt reply :)

In 'Table' style the formula looks like this:
=SUMPRODUCT(--(SUMIF([Category],[Category],[Sales])>SUMIF([Category],[@Category],[Sales])),--(MATCH([Category],[Category],0)=ROW([Category])-ROW($A$2)+1))+1
 
Upvote 0
You are welcome. Glad to help :)

Table style
=SUMPRODUCT(--(SUMIF([Category],[Category],[Sales])>SUMIF([Category],[@Category],[Sales])),--(MATCH([Category],[Category],0)=ROW([Category])-MIN(ROW([Category]))+1))+1

M.
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,772
Members
452,353
Latest member
strainu

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