Excel - Rank Function



Rank Function

The Excel Rank function is commonly used to rank or categorize the provided data values in the ranking order. It uses descending order by default, which means that the highest or topmost number will have a rank value of 1. For example, if an array stores 10 elements from 1 to 10, the default rank value for the number 10 should be 1.

The rank function is important for calculating the difference between the scores, sales figures, and profit margins and comparing the other available performance metrics. You may benefit from utilizing similar functions like RANK.AVG and RANK.EQ in the latest Excel version.

Compatibility

This advanced excel function is compatible with the following versions of MS-Excel −

  • Excel for Microsoft 365
  • Excel for Microsoft 365 for Mac
  • Excel for the web
  • Excel 2021
  • Excel 2021 for Mac
  • Excel 2019
  • Excel 2019 for Mac
  • Excel 2016

The RANK function interchanges the RANK.EQ appended in Excel 2010.

Syntax

The syntax of Rank function is as follows −

RANK (number, ref, [order ascending / descending])

Arguments

You can use the following arguments with the Rank function −

Argument Description Required / Optional
Number It specifies the number for which the rank should be calculated. Required
Ref It can be defined as the reference for the list of numbers. Required
Order It specifies the rank number. If the order is 0, then the rank numbers are sorted in the descending order otherwise they are sorted in the ascending order. Optional

Points to Remember

  • The RANK function will calculate the rank value of a given number from the provided dataset. This function works only for the numeric value, dates, and time. If the second argument, ref, contains a value other than a numeric one, it will be avoided.
  • The RANK function retrieves the #N/A! Error if the supplied ref is not present in the provided array.
  • You may also rank elements in the non-consecutive cells of the array.

Examples of Rank Function

Practice the following examples to learn the use of the Rank function in Excel.

Example 1

The RANK function will calculate the rank value of a given number from the provided dataset.

Solution

Step 1 − We will consider a small dataset with employee names and salaries in this example. We will learn how to calculate an employee's rank with a salary of 5000. We will go to the D10 cell to calculate the required salary rank.

Excel RANK Function 1

Step 2 − After that type the formula =RANK(C4,C3:C7,0) to the D10 cell.

Excel RANK Function 2

Step 3 − After that press the Enter key and the resulting value is 2, which simply means that 5000 is the 2nd highest salary among the provided dataset. To display the formula, view the formula bar of the D10 cell.

Excel RANK Function 3

Example 2

The RANK function retrieves the #N/A! error if the ref is not present in the provided array.

Solution

Step 1 − In this example, we will try to calculate the rank for the number not present in the provided data values. We will also understand why sometimes the RANK function displays the #N/A! value. Go to the F2 cell, and type the value 1200.

Excel RANK Function 4

Step 2 − Now will go to the D10 cell and type =RANK(F2,C3:C7,0). This formula will search the F2 value in the range C3:C7. Sample snapshot for the same is provided below:

Excel RANK Function 5

Step 3 − Press the Enter key. This will display the #N/A! error, as the value 1200 is not present in the specified range. Refer to the image below for proper guidance.

Excel RANK Function 6

Example 3

You may also rank elements in the non-consecutive cells of the array.

Solution

Step 1 − In this example, we will calculate the rank of the C3 cell among the C3, C4, and C6 cells. Since the by default rank function sorts values in descending order, it means that the highest or greatest value is ranked as 1. So, here are the values: 60000, 5000, and 1000. 1000 comes in the third place. To calculate this go to the D10 cell and type the formula =IFERROR(RANK(C3, (C3, C4, C6)), ).

Excel RANK Function 7

Step 2 − After that, press the Enter key. This will display the result value as 3.

Excel RANK Function 8

Conclusion

This powerful RANK function may be wrapped with other functions, like COUNTIF, if you wish to rank the duplicate elements separately, IF statement, and SUMPRODUCT. The profit or losses of the specific company can also be predicted by merging these functions.

Advertisements