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 list of values in ascending order

METHOD 1. Rank list of values in ascending order using Excel formula

EXCEL

=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.

METHOD 1. Rank list of values in ascending order using VBA

VBA

Sub Rank_list_of_values_in_ascending_order()
'declare variables
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)

End Sub

Explanation about how to rank list of values in ascending order

EXPLANATION

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)
ARGUMENTS
number: A number that you rank.
range: A range that contains the numbers to rank.

RELATED TOPICS

Related Topic Description Related Topic and Description
How to rank a list of values using Excel and VBA
How to return most frequently occurring text using Excel and VBA