Rank list of value in ascending order
This tutorial shows how to rank a list of values in ascending order using an Excel formula or VBA
Example: Rank list of values in ascending order
=RANK(C5,$C$5:$C$10,1)
|
This formula uses the Excel RANK function, with a rank order of 1, to rank values in a list in an ascending order. If a list contains same numbers the RANK function will give them the same rank.
|
Sub Rank_list_of_values_in_ascending_order()
'declare variables
Dim ws As Worksheet
Dim ws As Worksheet
Set ws = Worksheets("Analysis")
'rank a list of values
ws.Range("D5") = Application.WorksheetFunction.Rank(ws.Range("C5"), ws.Range("$C$5:$C$10"), 1)
ws.Range("D5") = Application.WorksheetFunction.Rank(ws.Range("C5"), ws.Range("$C$5:$C$10"), 1)
End Sub
EXPLANATION
This tutorial shows how to rank a list of values in ascending order through the use of an Excel formula or VBA.
The Excel and VBA method both use the RANK function, with an order of 1, to rank a range of values.
FORMULA
=RANK(number,range,1)
=RANK(number,range,1)
ARGUMENTS
number: A number that you rank.
range: A range that contains the numbers to rank.
number: A number that you rank.
range: A range that contains the numbers to rank.
RELATED TOPICS
Related Topic | Description | Related Topic and Description |
---|---|---|
Rank list of value | How to rank a list of values using Excel and VBA | |
Return most frequently occurring text | How to return most frequently occurring text using Excel and VBA |