Rank duplicate numbers

ORoxo

Board Regular
Joined
Oct 30, 2016
Messages
149
Hello again, guys
I'm using the following formula to rank Risks according to the value in a cell. However, right now, the formula ignores duplicates.

Let's say I have the same risk listed twice - which can happen. The formula will just ignore this and assign it the next available number. I was hoping there's some way for it take into consideration the previous number assigned to a specific risk.
This is a sample and the expected result:

Capture.png



Thanks!
 
Last edited:

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Maybe:


ABCDE
1RiskValueAreaExpected Result
2RP173AAA1
3RP173AAA1
4RP257BBB2
5RP319CCC5
6RP439DDD4
7RP556DDD3

<tbody>
</tbody>
Sheet5

Array Formulas
CellFormula
D2{=SUM(SIGN(FREQUENCY(IF($B$2:$B$8>B2,MATCH($A$2:$A$8,$A$2:$A$8,0)),ROW($A$2:$A$8)-ROW($A$2)+1)))+1}

<tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>
 
Upvote 0
Maybe:


ABCDE
1RiskValueAreaExpected Result
2RP173AAA1
3RP173AAA1
4RP257BBB2
5RP319CCC5
6RP439DDD4
7RP556DDD3

<tbody>
</tbody>
Sheet5

Array Formulas
CellFormula
D2{=SUM(SIGN(FREQUENCY(IF($B$2:$B$8>B2,MATCH($A$2:$A$8,$A$2:$A$8,0)),ROW($A$2:$A$8)-ROW($A$2)+1)))+1}

<tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>

This is not exactly what I am looking for although it works for that sample, I'm sorry. I will try to make use of a better example:

RiskValueDepartmentExpected Value
RA1122A&T1
RA1122A&T1
RA4422A&T2
RA4522A&T3
RA4622A&T4
RC827,5COM1
RC827,5COM1
RC827,5COM1
RC827,5COM1
RC3422COM2

<tbody>
</tbody>


Basically, I would like the formula to have into consideration department and the number of the risk. It should rank same for the same risk, regardless of how many times it appears and it should rank them at a department level only.

Thanks once again for the support
 
Last edited:
Upvote 0
Try:

Excel 2012
ABCD
1RiskValueDepartmentExpected Value
2RA1122A&T1
3RA1122A&T1
4RA4422A&T2
5RA4522A&T3
6RA4622A&T4
7RC827,5COM1
8RC827,5COM1
9RC827,5COM1
10RC827,5COM1
11RC3422COM2

<colgroup><col style="width: 25pxpx"><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

Array Formulas
CellFormula
D2{=SUM(SIGN(FREQUENCY(IF($C$2:$C$11=C2,IF(MID($A$2:$A$11,3,9)+0<MID(A2,3,9)+0,MATCH($A$2:$A$11,$A$2:$A$11,0))),ROW($A$2:$A$11)-ROW($A$2)+1)))+1}

<thead>
</thead><tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>



Using column A for the rating is a bit problematic. I assumed that there is a 2-character prefix, and then the rest of the value is the rating.
 
Upvote 0
Try:

Excel 2012
ABCD
1RiskValueDepartmentExpected Value
2RA1122A&T1
3RA1122A&T1
4RA4422A&T2
5RA4522A&T3
6RA4622A&T4
7RC827,5COM1
8RC827,5COM1
9RC827,5COM1
10RC827,5COM1
11RC3422COM2

<tbody>
</tbody>
Sheet1

Array Formulas
CellFormula
D2{=SUM(SIGN(FREQUENCY(IF($C$2:$C$11=C2,IF(MID($A$2:$A$11,3,9)+0<mid(<font color="#FF00FF">A2</mid(<font color="Blue"><font color="Red"><mid(,3,9</mid()+0,MATCH($A$2:$A$11,$A$2:$A$11,0))),ROW($A$2:$A$11)-ROW($A$2)+1)))+1}

<tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>



Using column A for the rating is a bit problematic. I assumed that there is a 2-character prefix, and then the rest of the value is the rating.

Eric, thanks again fr your help! Could you please check the part in red bold on your formula?

Thanks
 
Upvote 0
Ugh! Sorry, I still get caught occasionally by a quirk where the forum interprets a < as an HTML tag and not as an operator:

Code:
=SUM(SIGN(FREQUENCY(IF($C$2:$C$11=C2,IF(MID($A$2:$A$11,3,9)+0< MID(A2,3,9)+0,MATCH($A$2:$A$11,$A$2:$A$11,0))),ROW($A$2:$A$11)-ROW($A$2)+1)))+1
 
Upvote 0
Ugh! Sorry, I still get caught occasionally by a quirk where the forum interprets a < as an HTML tag and not as an operator:

Code:
=SUM(SIGN(FREQUENCY(IF($C$2:$C$11=C2,IF(MID($A$2:$A$11,3,9)+0< MID(A2,3,9)+0,MATCH($A$2:$A$11,$A$2:$A$11,0))),ROW($A$2:$A$11)-ROW($A$2)+1)))+1

Thanks, Eric! This does work perfectly. I would just like it to take int consideration column B. Would that be possible?
 
Upvote 0
In what way do you want to consider column B? As part of the rating (if so, how), or as part of the department grouping (again, if so, how)?
 
Upvote 0
In what way do you want to consider column B? As part of the rating (if so, how), or as part of the department grouping (again, if so, how)?

I want it to consider it as part of the ranking.

In other words, I want to rank the risks according to the value in column B and within each department, that's the general rule. Let's say, however, that I have two rows in my dataset with the same Risk Name. In that case, I want it to give it the same rank.

If it's not yet clear let me know, I will try to explain it in another way.
 
Upvote 0
I don't think I quite picture it. Could you post an example? And could you verify that the risk ranking is based on column A, without the first 2 characters?
 
Upvote 0

Forum statistics

Threads
1,214,386
Messages
6,119,216
Members
448,876
Latest member
Solitario

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