Rank across worksheet columns

collegeitdept

Board Regular
Joined
Nov 14, 2008
Messages
185
Hello,

Does anyone know of a way to get the rank of an aggregate of multiple columns across sheets in a workbook please?

I found a non-workable but good formula:
=SUMPRODUCT(--(A$2:A$10+B$2:B$10>A2+B2))+1

BUT! it doesn't allow for a lookup/search variable - the columns are "locked" it does not support an index match formula.

IE: rank current sales number Year to date = Index match first day of year : index match current date *** only do this across 3 worksheets.


Excel 2010 has an excellent new function called: aggregate... but it doesn't support rank!

Here I have the average of all sales year to date from 3 separate worksheets within the workbook:

=AGGREGATE(1,4,INDEX('E! Online US'!$A$12:$L10000,MATCH(DATE(YEAR($B$3),1,1),'E! Online US'!$A$12:$A10000,0),MATCH(G$2,'E! Online US'!$A$11:$L$11,0)):INDEX('E! Online US'!$A$12:$L10000,MATCH($B$3,'E! Online US'!$A$12:$A10000,0),MATCH(G$2,'E! Online US'!$A$11:$L$11,0)),INDEX('Eonline App'!$A$12:$L10000,MATCH(DATE(YEAR($B$3),1,1),'Eonline App'!$A$12:$A10000,0),MATCH(G$2,'Eonline App'!$A$11:$L$11,0)):INDEX('Eonline App'!$A$12:$L10000,MATCH($B$3,'Eonline App'!$A$12:$A10000,0),MATCH(G$2,'Eonline App'!$A$11:$L$11,0)),INDEX('EOL Mobile Web'!$A$12:$L10000,MATCH(DATE(YEAR($B$3),1,1),'EOL Mobile Web'!$A$12:$A10000,0),MATCH(G$2,'EOL Mobile Web'!$A$11:$L$11,0)):INDEX('EOL Mobile Web'!$A$12:$L10000,MATCH($B$3,'EOL Mobile Web'!$A$12:$A10000,0),MATCH(G$2,'EOL Mobile Web'!$A$11:$L$11,0)))



I need an 'aggregate' formula that can do rank.

Can someone please help?




 
Would there be away for it to be done without breaking it down into two steps please?

This is fairly complicated problem - is hard to say without actually seeing the data. You can send me a workbook if you want. Otherwise maybe if you paste some of the data into this forum you will get more help.
 
Last edited:
Upvote 0

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
I found a sumproduct function that provides the rank... and being that sumproduct can also do a lookup/condition as well maybe sumproduct can be used?

=SUMPRODUCT(--($A$2:$A$100=$A2),--(B$2:B$100>B2))+1


Thanks.







 
Upvote 0
I found a sumproduct function that provides the rank... and being that sumproduct can also do a lookup/condition as well maybe sumproduct can be used?

=SUMPRODUCT(--($A$2:$A$100=$A2),--(B$2:B$100>B2))+1


Thanks.


How is one supposed to use that formula? What does it do.

I just tested by putting random numbers between 1 and 500 into A2:B100 and then entered that formula into C2 and dragged down. It filled each cell with either a 1 or 2. What exactly is it supposed to be ranking? What do the returned values even mean?
 
Upvote 0
How is one supposed to use that formula? What does it do.

I just tested by putting random numbers between 1 and 500 into A2:B100 and then entered that formula into C2 and dragged down. It filled each cell with either a 1 or 2. What exactly is it supposed to be ranking? What do the returned values even mean?





Column A is the category/variable... Column B is the data.

So it can rank all Column B rows that has "Sales" in it's associated rows in column A.
 
Last edited:
Upvote 0

Have you considered consolidating all of the data onto the same spreadsheet and then using a pivottable to analyse your data. A pivot table can aggregate and rank your data with ease.
To consolidate your data all you could insert an new column which shows the spreadsheet origin.

We can still look for a formula solution of course but a pivot table could solve a problem like the one you have shown in that workbook very quickly.


This is what your proposed summary table looks like:

AggregateRankRankRank
DateSalesUnitsPalettes
15/08/2013
22/08/2013
29/08/2013
5/09/2013
12/09/2013
19/09/2013
26/09/2013
3/10/2013
10/10/2013
17/10/2013
24/10/2013

<tbody>
</tbody>


However I have notice the sample data you have provided does not actually have any August dates:

Here is a sample of what a pivot table was able to return after I combined your spreadsheets:

Row LabelsPalettesSalesUnits
7/09/20133383124
13/09/2013174480
14/09/201321336
19/09/2013162260
20/09/2013141152
21/09/2013183070
24/09/20132981238
25/09/201386155416
26/09/2013193268
27/09/201380122230
28/09/2013123356
29/09/2013241219
30/09/201312256156
1/10/20133255113
2/10/2013516381837
3/10/2013375979

<tbody>
</tbody>

etc (the data continues on until 24th October 2013)

That is sum but I can turn that into rank with the click of button:

Row LabelsPalettesSalesUnitsGrand Total
7/09/2013971010
13/09/201317131213
14/09/201330252224
19/09/201318211618
20/09/201320271920
21/09/201316181415
24/09/201311857
25/09/20135522
26/09/201315161514
27/09/20136666
28/09/201322151716
29/09/201312262823
30/09/201331188
1/10/201310121111
2/10/20131111
3/10/20138101312

<tbody>
</tbody>



Or I can sum by Platform (your worksheet name) and month

WorksheetDatePalettesSalesUnitsGrand Total
Platform 1Sep29539211491836
Oct63939510112045
Platform 2Sep76181295552
Oct1903485361074
Platform 3Sep224659127
Oct89257309655
Platform 4Sep342128
Oct5383144280
Platform 5Sep767181228
Oct198284308790
Grand Total1641206139137615

<tbody>
</tbody>

I know this is not what you asked for but it a potential is solution in case an MVP can't help you (I am no where near as good as those guys). And at least it keeps your post visible - someone else might see it and offer a better solution.
 
Upvote 0
Column A is the category/variable... Column B is the data.

So it can rank all Column B rows that has "Sales" in it's associated rows in column A.

Thank you. I had a feeling it might be something like that. Rank by segment.

That is a useful formula. Thank your for sharing. I have a formula that does a similar job. But it is an array formula. Yours is simpler.

=SUM(N(B2<=IF(A2=Segment,Values,-1E+40)))

(Segment and Values are named ranges).
 
Upvote 0
I can't do that... that's not even the spreadsheet I will be using. it's full of random data.

The actual corporate file is huge and I cannot modify because other users.



Again what's needed is to find the ranking of all "sales" columns from all worksheets.

Can any MVP help please?
 
Upvote 0

Forum statistics

Threads
1,215,040
Messages
6,122,806
Members
449,095
Latest member
m_smith_solihull

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