Ranking of data based on multiple criteria

siddharthnk

New Member
Joined
Jun 20, 2013
Messages
48
Hi All,

I need help with an excel formula which will allocate serial numbers a set of numbers in a column. The data is as follows.

YES/NOCODESSERIAL NO'S
YES123451
YES123462
NO12356
YES123451
NO12356
YES123573
YES123462
YES123462
YES123474
YES123474

<tbody>
</tbody>

As you can see, the first column in a yes/no column which has only yes's and no's which are formulated based on certain other criteria based on information present in other cells in the same row. The second column consists of project codes.
What I need is a formula which will allocate serial numbers to the third column based on the combination of yes's and the codes. As you can see in the screenshot, any code which is repeated with a yes has the same serial number has the same serial number. The rows where there is a no in the first column needs to be blank. Also, the codes will not be sorted in ascending or descending order and will keep increasing every week.
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
The serial numbers or the rank are related such that every time the same code appears with a yes, it should have the same rank / serial number. A particular code can appear with a "no" but as I said earlier it needs to be ignored and has to be blank.
 
Upvote 0
Hi,

Yeah, but why is 12357 ranked 3, and 12347 ranked 4?
 
Upvote 0
Code:
Yeah, but why is 12357 ranked 3, and 12347 ranked 4 [COLOR="#B22222"](twice)[/COLOR]?
 
Upvote 0
In C2 control+shift+enter, not just enter, and copy down:
Rich (BB code):
=IF($A2="Yes",IF(ISNUMBER(MATCH(B2,$B$1:B1,0)),VLOOKUP(B2,$B$1:C1,2,0),
    SUM(IF(FREQUENCY(IF($A$2:A2="yes",$B$2:B2),$B$2:B2),1))),"")
 
Upvote 0
Hi Aladin,

Thanks for the formula. When I apply it, I get a 4 after 2. The 3rd rank is missing.

YES/NOCODES
YES123451
YES123562
NO13456
YES123451
NO13456
YES123562
YES123574
NO13456
NO13456
YES123585

<colgroup><col style="width:48pt" span="3" width="64"> </colgroup><tbody>
</tbody>
 
Upvote 0
Hi Aladin,

Thanks for the formula. When I apply it, I get a 4 after 2. The 3rd rank is missing.

YES/NOCODES
YES123451
YES123562
NO13456
YES123451
NO13456
YES123562
YES123574
NO13456
NO13456
YES123585

<tbody>
</tbody>

Control+shift+enter means press down the control and the shift keys at the same time while you the enter key. When done properly, Excel itself puts a pair of { and } around the formula.
 
Upvote 0
Thanks Aladin. The formula works! What if the colums are next to each other. I never mentioned the column names because they aren't next to each other. There might be a couple of columns between the yes/no column and code column. Does the formula work the same?
 
Upvote 0

Forum statistics

Threads
1,213,526
Messages
6,114,122
Members
448,550
Latest member
CAT RG

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