Rank Uniquely by criteria and value...

RossShep92

New Member
Joined
Jan 20, 2020
Messages
7
Office Version
  1. 2019
Platform
  1. Windows
Hi

I am trying to rank values in descending order using a criteria (in this case major customer group) and value, but want the ranks to also be unique.

I have used some sumproduct formulas that seem to get me close, but then i cannot ensure that the rank value is unique.

A sample of the data is below with an idea of how i need to rank the data. Excel sheet is a few thousand rows, and i will be ranking multiple numerical columns based on the "customer" and "values" within the columns so i cant sort.

Help appreciated!

Thanks,
Ross

CustomerValueRank
Discounters
13​
4​
Discounters
4​
5​
Discounters
16​
3​
Discounters
16​
3​
Discounters
16​
1​
Others
1​
4​
Others
3​
3​
Others
7​
1​
Others
5​
2​
Export
20​
9​
Export
20​
8​
Export
40​
7​
Export
40​
6​
Export
40​
5​
Export
40​
4​
Export
60​
3​
Export
60​
2​
Export
60​
1​
ASDA
8​
1​
ASDA
2​
2​
ASDA
1​
3​
ASDA
1​
4​
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Hi,

Welcome to the Board!

I have written a ranking formula for you. Certainly, it takes position of the entries into account, too.

Book1
ABCD
1CustomerValueRankNew rank
2Discounters1345
3Discounters459
4Discounters1636
5Discounters1637
6Discounters1618
7Others1419
8Others3320
9Others7122
10Others5221
11Export20910
12Export20811
13Export40712
14Export40613
15Export40514
16Export40415
17Export60316
18Export60217
19Export60118
20ASDA814
21ASDA223
22ASDA131
23ASDA142
Sheet1
Cell Formulas
RangeFormula
D2:D23D2=COUNTIF($A$2:$A$23,"<"&A2)+COUNTIFS($A$2:$A$23,A2,$B$2:$B$23,"<"&B2)+COUNTIFS($A$2:$A2,A2,$B$2:$B2,B2)
 
Upvote 0
Hi and welcome to MrExcel!

Check if this you need:
Book1
ABC
1CustomerValueRank
2Discounters134
3Discounters45
4Discounters161
5Discounters162
6Discounters163
7Others14
8Others33
9Others71
10Others52
11Export208
12Export209
13Export404
14Export405
15Export406
16Export407
17Export601
18Export602
19Export603
20ASDA81
21ASDA22
22ASDA13
23ASDA14
sheet
Cell Formulas
RangeFormula
C2:C23C2=COUNTIFS($A$2:$A$23,A2,$B$2:$B$23,">"&B2)+COUNTIFS(A$2:A2,A2,B$2:B2,B2)
 
Upvote 0
Thank you very much for the welcome.

I think this is exactly what i need :)

I will give it a whirl tomorrow at work and let you know the outcome.

Thanks again,
Ross
 
Upvote 0
Hi,

Welcome to the Board!

I have written a ranking formula for you. Certainly, it takes position of the entries into account, too.

Book1
ABCD
1CustomerValueRankNew rank
2Discounters1345
3Discounters459
4Discounters1636
5Discounters1637
6Discounters1618
7Others1419
8Others3320
9Others7122
10Others5221
11Export20910
12Export20811
13Export40712
14Export40613
15Export40514
16Export40415
17Export60316
18Export60217
19Export60118
20ASDA814
21ASDA223
22ASDA131
23ASDA142
Sheet1
Cell Formulas
RangeFormula
D2:D23D2=COUNTIF($A$2:$A$23,"<"&A2)+COUNTIFS($A$2:$A$23,A2,$B$2:$B$23,"<"&B2)+COUNTIFS($A$2:$A2,A2,$B$2:$B2,B2)

Hi

Thank you for the welcome but i dont think its quite what i needed.

I needed individual rankings by "customer" so each customer was ranked from high to low values.

I believe the reply below has done this :)

Thanks,
Ross
 
Upvote 0
Hi and welcome to MrExcel!

Check if this you need:
Book1
ABC
1CustomerValueRank
2Discounters134
3Discounters45
4Discounters161
5Discounters162
6Discounters163
7Others14
8Others33
9Others71
10Others52
11Export208
12Export209
13Export404
14Export405
15Export406
16Export407
17Export601
18Export602
19Export603
20ASDA81
21ASDA22
22ASDA13
23ASDA14
sheet
Cell Formulas
RangeFormula
C2:C23C2=COUNTIFS($A$2:$A$23,A2,$B$2:$B$23,">"&B2)+COUNTIFS(A$2:A2,A2,B$2:B2,B2)

Thank you very much for the welcome.

I think this is exactly what i need :)

I will give it a whirl tomorrow at work and let you know the outcome.

Thanks again,
Ross
 
Upvote 0

Forum statistics

Threads
1,214,998
Messages
6,122,643
Members
449,093
Latest member
Ahmad123098

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