Juggler_IN
Active Member
- Joined
- Nov 19, 2014
- Messages
- 358
- Office Version
- 2003 or older
- Platform
- Windows
Hi,
I have a formula to Rank data, say in Range("A1:A5"). The formula is: <a1) countif($a$1:$a$5,$a$1:$a$5&""))+1<a1)="" countif($a$1:$a$5,$a$1:$a$5&""))+1[="" code]
<a1) countif($a$1:$a$5,$a$1:$a$5&""))+1[="" code]
<a1) countif($a$1:$a$5,$a$1:$a$5&""))+1
SUMPRODUCT(( $A$1:$A$5 < A1 ) / COUNTIF( $A$1:$A$5 , $A$1:$A$5&"" )) + 1
<a1) countif($a$1:$a$5,$a$1:$a$5&""))+1
Output, for a sample data in A1 to A5, is:
[TABLE="width: 128"]
<tbody>[TR]
[TD="width: 64"]Apple[/TD]
[TD="width: 64, align: right"]1[/TD]
[/TR]
[TR]
[TD]Banana[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD]Orange[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD]Mango[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD]Apple[/TD]
[TD="align: right"]1[/TD]
[/TR]
</tbody>[/TABLE]
I tried to convert it into a UDF but I am not getting an executable UDF. The UDF is:
What am I missing here?</a1)></a1)></a1)></a1)>
I have a formula to Rank data, say in Range("A1:A5"). The formula is: <a1) countif($a$1:$a$5,$a$1:$a$5&""))+1<a1)="" countif($a$1:$a$5,$a$1:$a$5&""))+1[="" code]
<a1) countif($a$1:$a$5,$a$1:$a$5&""))+1[="" code]
<a1) countif($a$1:$a$5,$a$1:$a$5&""))+1
SUMPRODUCT(( $A$1:$A$5 < A1 ) / COUNTIF( $A$1:$A$5 , $A$1:$A$5&"" )) + 1
<a1) countif($a$1:$a$5,$a$1:$a$5&""))+1
Output, for a sample data in A1 to A5, is:
[TABLE="width: 128"]
<tbody>[TR]
[TD="width: 64"]Apple[/TD]
[TD="width: 64, align: right"]1[/TD]
[/TR]
[TR]
[TD]Banana[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD]Orange[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD]Mango[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD]Apple[/TD]
[TD="align: right"]1[/TD]
[/TR]
</tbody>[/TABLE]
I tried to convert it into a UDF but I am not getting an executable UDF. The UDF is:
Code:
Public Function RS(ByVal rngItem As Range, ByRef rngData As Range) As Double
With Application.WorksheetFunction
RS = .SumProduct((rngData < rngItem) / .CountIf(rngData, rngData & "")) + 1
End With
End Function
What am I missing here?</a1)></a1)></a1)></a1)>
Last edited: