I have a column of items that have a weighted ranking value in column "C", and I need a numerical series rank in column "A" that is based on column "C".
Column "C" is always sorted smallest to largest.
Excel 2007
The code I have so far will fill Column "A" without accounting for duplicates:
Any Help would be greatly appreciated.
Column "C" is always sorted smallest to largest.
Excel Workbook | |||||
---|---|---|---|---|---|
A | B | C | |||
1 | Numerical Rank | ITEM | Weighted Rank | ||
2 | Item to be ranked 1 | 5.56 | |||
3 | Item to be ranked 2 | 21.60 | |||
4 | Item to be ranked 3 | 21.95 | |||
5 | Item to be ranked 4 | 22.05 | |||
6 | Item to be ranked 5 | 22.06 | |||
7 | Item to be ranked 6 | 22.30 | |||
8 | Item to be ranked 7 | 22.30 | |||
9 | Item to be ranked 8 | 22.38 | |||
10 | Item to be ranked 9 | 22.50 | |||
11 | Item to be ranked 10 | 22.50 | |||
12 | Item to be ranked 11 | 22.50 | |||
13 | Item to be ranked 12 | 23.54 | |||
14 | Item to be ranked 13 | 23.56 | |||
15 | Item to be ranked 14 | 23.75 | |||
16 | Item to be ranked 15 | 23.95 | |||
17 | Item to be ranked 16 | 23.95 | |||
18 | Item to be ranked 17 | 24.06 | |||
19 | Item to be ranked 18 | 24.06 | |||
20 | Item to be ranked 19 | 24.06 | |||
21 | Item to be ranked 20 | 24.25 | |||
22 | Item to be ranked 21 | 24.26 | |||
23 | Item to be ranked 22 | 24.35 | |||
24 | Item to be ranked 23 | 24.45 | |||
25 | Item to be ranked 24 | 24.70 | |||
26 | Item to be ranked 25 | 25.05 | |||
27 | Item to be ranked 26 | 25.11 | |||
28 | Item to be ranked 27 | 25.35 | |||
29 | Item to be ranked 28 | 26.20 | |||
Sheet2 |
#VALUE!
The code I have so far will fill Column "A" without accounting for duplicates:
Code:
Private Sub cmdTestRank_Click()
Dim LR As Long
LR = Cells(Rows.Count, 3).End(xlUp).Row 'find last row used
MsgBox (LR) 'test msgbox purpose to verify last row- DELETE later.
With Worksheets("Sheet2")
.Range("A2").Value = "1"
.Range("A2").Select
End With
ActiveCell.Offset(1, 0).Resize(LR - 2, 1).FormulaR1C1 = "=R[-1]C+1"
End Sub
Any Help would be greatly appreciated.