Rank list of value

This tutorial shows how to rank a list of values using an Excel formula or VBA

Example: Rank list of values

Rank list of values

METHOD 1. Rank list of values using Excel formula

EXCEL

=RANK(C5,$C$5:$C$10)
This formula uses the Excel RANK function to rank values in a list. If a list contains same numbers the RANK function will give them the same rank.

METHOD 1. Rank list of values using VBA

VBA

Sub Rank_list_of_values()
'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"))

End Sub

Explanation about how to rank list of values

EXPLANATION

EXPLANATION

This tutorial shows how to rank a list of values through the use of an Excel formula or VBA.
The Excel and VBA method both use the RANK function to rank a range of values.
FORMULA
=RANK(number,range)
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 return most frequently occurring text using Excel and VBA