## Excel RANK Function

Excel Rank formula is used to gives us the rank of a given data set of numbers based on the data set or we can say by comparing the other numbers in the data set, the rank function was an inbuilt function for excel 2007 and earlier versions, for newer versions above 2007 we have an inbuilt function as Rank.Avg and Rank.Eq functions.

Rank Function is a built-in function in MS Excel. It falls under the category of STATISTICAL functions in Excel. The function is used to get the rank of a given number from the list of numbers.

### Syntax

The rank formula in excel has three arguments, out of which the first two are required, and the last one is optional.

4.9 (1,353 ratings) 35+ Courses | 120+ Hours | Full Lifetime Access | Certificate of Completion

**number****=**A number for which the rank is to be found out.**ref =**the range of numbers w.r.t which the rank of a given number is to be found**order =**the order (ascending or descending) in which the numbers should be ranked. 0 = Descending order; 1 = Ascending order. If the order is omitted, the default value is zero, i.e., descending order.

**How to Use RANK Function in Excel? (with Examples)**

The given function is a Worksheet (WS) function. As a Worksheet function, it can be entered as a part of the formula in a worksheet cell. Refer to the examples explained in this article as you proceed to learn more.

#### Example #1 – Find Steve’s Rank in Maths

- In the above example, the Marks of the Students in Maths and Science subjects are shown. To find Steve’s rank in Maths, we would use the Excel RANK function.
- The first parameter is the input value, of which the rank is to be calculated. Here, B6 represents Steve’s marks in Maths, i.e., 68.
- The 2
^{nd}parameter, the total cells containing Maths marks are from B1 to B11. So, the range is B1:B11, which comprises all students’ marks in Maths.

- The highest value represents the rank 1, and the lowest representing the last rank. So, the 3
^{rd}parameter is skipped, and Excel treats it as 0; the default order is**descending.** - RANK (B6, B1: B11) returns the rank of the student named Steve in subject Maths as 8, 50 being the lowest (B2) and 99 (B10) being the highest marks in Maths subject.

#### Example #2 – Find the Lowest Runtime from the Race Record

- In the above example, different Time values are given. We have to find the lowest runtime from the given records.
- The time values range from cell B1: B6. So, the cell range is named as a table and given the name ‘my time.’ It acts as an alias for B1: B6.

- Unlike example #1, here, the lowest runtime indicates the 1
^{st}rank, and the highest runtime indicates the last rank. So, we need to apply**ascending**order while calculating the rank in excel. Hence, the 3^{rd}parameter is given as 1. - So, RANK (B3, my time, 1) returns the lowest runtime as the rank 1 from the given race times.

- As a result, at 4:30 (cell B3), the lowest one is recorded as rank 1, and at 9:00 (cell B5), the longest one is recorded as the last, i.e., 4th rank.

#### Example #3 – Value Not Present

- As shown in the above figure, the 1st parameter, i.e., the value for which the rank is to be calculated, is NOT present in the range of cells given in the 2nd parameter, then the excel rank formula returns #NA! indicating that the value is invalid, i.e., not present in the given range of reference cells.
- As shown in the above figure, number 59 is not present in the range, and hence #NA! is returned as a result shown in cell C8.
- One must correct the 1st parameter in such a case.

#### Example #4 – Text Formatted Numerical Values

- As shown in the above figure, the 1st parameter, i.e., the value for which the rank is to be calculated, is given in the text format, i.e., “5,” as shown in the above figure. The value does not remain a number as it is quoted in double-quotes and hence treated as a text.
- Since the rank cannot be calculated over text data, the function returns #N/A! an error indicating that the value is Not Available in the given range of cells. The resultant cell C6 has #N/A returned as the result of the function.

- One must correct the 1st parameter in such a case.

**Things to Remember**

- The minimal parameter the Excel RANK function takes is 2.
- The 3rd parameter of the RANK function is optional and zero (descending order) by default. If specified as 1, the function treats it as ascending order.
- There is no RANKIF formula to perform a conditional ranking similar to COUNTIF in Excel. It needs the usage of an additional Excel function to achieve the same.
- When the given number for which the rank is to be calculated (1
^{st}parameter) is not present in the range of cells given as a reference to the function (2^{nd}parameter), then #N/A! error occurs. - The rank formula does not support any text values or the text representation of the numeric values as the RANK cannot be applied to text data. If provided so, this excel function returns #N/A error, as explained.

### Recommended Articles

This has been a guide to RANK Function in Excel. Here we discuss how to use the RANK function in Excel along with practical examples and downloadable excel templates. You may also look at these useful functions in excel –

- 35+ Courses
- 120+ Hours
- Full Lifetime Access
- Certificate of Completion