RANK Function in☝️ Google Sheets Explained (Definition, Syntax, How to Use It, Examples)

This guide covers everything you need to know about the Google Sheets RANK function, including its definition, syntax, use cases, and how to use it.

What is the RANK Function? How Does It Work?

The RANK function in Google Sheets tells you the position of a specific value compared to others in a set. Imagine you have a list of student scores and you want to see where one student’s score stands compared to others. The RANK function can do that for you.

You mainly need two things for this function: the ‘value’ you want to check and the list or ‘data’ of values you’re comparing it to. There’s also an optional third part, ‘is_ascending’, which lets you decide if you want the numbers ranked from highest to lowest (default) or the other way around.

One thing to remember is if two values are the same, they’ll get the same rank. For example, if two students both have the highest score and are ranked first, the next highest score will be ranked third.

You can use the RANK function in many situations, not just for student scores. It’s useful anytime you need to see how something measures up against others, like product sales, house prices, or sports scores.

RANK Syntax

The syntax and arguments for the function are as follows:

RANK(value, data, [is_ascending])

Where:

  • value: This is the value whose rank will be determined. It is the number you want to rank within the data set. It can be a number, a cell reference, or a formula that results in a number.
  • data: This is the array or range containing the dataset to consider. It is the group of data that the rank of the value will be determined from. This argument can be a list of numbers, cell references, or a range of cells.
  • is_ascending: This is an optional argument. By default, it is set to 0, meaning that the data values are considered in descending order. If you set is_ascending to 1, the function will rank the values in the data in ascending order.

Examples of How to Use the RANK Function

Here are some practical examples of how to use the RANK function in Google Sheets:

Example #1: Ranking Sales Figures

Let’s say you have a list of sales figures and want to rank them in descending order. You have your sales figures in cells A2 to A10 and want to know the rank of the sales figure in cell A5. Your RANK function would look like this:

=RANK(A5, A2:A10, 0)

This formula will return the rank of the sales figure in cell A5 among the sales figures in the range A2 to A10. The “0” at the end of the function indicates that you want the figures ranked in descending order.

Example #2: Ranking Test Scores

Suppose you are a teacher and have a list of test scores you want to rank in ascending order. Your test scores are in cells B2 to B20 and want to know the rank of the score in cell B10. Your RANK function would look like this:

=RANK(B10, B2:B20, 1)

This formula will return the rank of the test score in cell B10 among the scores in the range B2 to B20. The “1” at the end of the function indicates that you want the scores ranked in ascending order.

Example #3: Ranking Employee Performance

If you are a manager and have a list of employee performance scores you want to rank in descending order, you can use the RANK function. Your performance scores are in cells C2 to C15 and want to know the rank of the score in cell C7. Your RANK function would look like this:

=RANK(C7, C2:C15, 0)

This formula will return the rank of the performance score in cell C7 among the scores in the range C2 to C15. The “0” at the end of the function indicates that you want the scores ranked in descending order.

Example #4: Ranking Product Sales

You can use the RANK function if you’re a business owner and want to rank your product sales in descending order. If your product sales are in cells D2 to D30, and you want to know the rank of the sales in cell D15, your RANK function would look like this:

=RANK(D15, D2:D30, 0)

This formula will return the product sales rank in cell D15 among the sales in the range D2 to D30. The “0” at the end of the function indicates that you want the sales ranked in descending order.

RANK: Common Mistakes & Problems

When using the RANK function in Google Sheets, there are several common mistakes and problems that users often encounter:

  • Incorrect argument order: The RANK function requires at least two arguments in a specific order. The first argument should be the number you want to rank, and the second argument should be the cell range within which you want to rank the number. If you switch the order of these arguments, the function won’t work correctly.
  • Using non-numeric values: The RANK function can only rank numeric values. You’ll get an error if you try to use it with text or date values. Make sure all the values you’re trying to rank are numbers.
  • Ignoring the third argument: The third argument in the RANK function is optional, but it can be very useful. It lets you specify whether you want to rank numbers in ascending or descending order. If you ignore this argument, Google Sheets will assume you want to rank in descending order.
  • Not using absolute cell references: If you’re copying and pasting the RANK function to use it in different parts of your spreadsheet, you need to use absolute cell references. Otherwise, the cell range within your ranking numbers may shift, leading to incorrect results.
  • Using RANK with empty cells or cells with zero values: The RANK function does not handle empty cells or cells with zero values well. If your range includes these, it may throw off your rankings.
  • Not considering equal values: If two or more numbers in your range are the same, they will have the same rank. The next number will then skip a rank. For example, if you have three numbers (10, 10, and 8), both 10s will be ranked 1, and the 8 will be ranked 3, not 2. If you want each number to have a unique rank, use the RANK.EQ function instead.

Why Is RANK Not Working? Troubleshooting Common Errors

If your RANK function does not work as expected in Google Sheets, you might face one of the following common errors. Understanding these errors, their causes, and their solutions can help you quickly troubleshoot and resolve the issue.

#VALUE! Error

Cause: This error typically occurs when the function parameters are incorrect. For instance, if the RANK function refers to a cell containing text or non-numeric data, Google Sheets will return a #VALUE! error.

Solution: To fix this, you need to ensure that all the arguments you’re supplying to the RANK function are numbers. Check the cells you’re referring to with the function and ensure they contain numeric data. If there are any cells with text, you’ll need to remove or convert it to a number before the RANK function can work correctly.

#REF! Error

Cause: This error occurs when the range reference in your RANK function is invalid. For instance, if you’ve deleted a row or column originally included in the range for the RANK function, Google Sheets will return a #REF! error.

Solution: To resolve this issue, you need to correct the range reference in your function. Ensure that all the rows and columns you’re referring to in your function exist and haven’t been deleted.

#N/A Error

Cause: This error usually happens when the value you’re trying to rank isn’t within the range of values you specified. If Google Sheets can’t find the number you’re trying to rank, it will return a #N/A error.

Solution: To solve this problem, you must ensure that the number you’re trying to rank is included in the range of values you’ve specified in the function. Double-check your range and the number you’re trying to rank to ensure they’re correct.

#NAME? Error

Cause: This error occurs when Google Sheets doesn’t recognize the function name. If you’ve misspelled the function name or used incorrect syntax, Google Sheets will return a #NAME? error.

Solution: To resolve this error, make sure you’ve typed the function name correctly. The correct syntax is RANK(number, data, [is_ascending]). Make sure you’ve included all the necessary parameters and used the correct syntax for the function.

Using RANK With Other Google Sheets Functions

Combining RANK with other Google Sheets functions can enhance its utility and provide more complex and insightful data analysis. Here are a few examples of how to use RANK with other Google Sheets functions.

With SUM

Usage: You can use RANK with the SUM function to rank the total sum of a range of cells.

Example: If you have a list of salespeople and their monthly sales figures, you can use RANK and SUM together to rank them based on their total sales for a given period. In this case, if the sales figures are in cells B2 to B10, and the salesperson for whom you want to find the rank is in cell B5, you would use this formula:

=RANK(SUM(B5), SUM(B2:B10))

With AVERAGE

Usage: You can use RANK along with the AVERAGE function to rank the average value of a range of cells.

Example: If you have a list of students and their test scores for several subjects, you can use RANK and AVERAGE to rank them based on their average scores. If the scores are in cells C2 to C10, and the student for whom you want to find the rank is in cell C5, the formula would be as follows:

=RANK(AVERAGE(C5), AVERAGE(C2:C10))

With MAX

Usage: RANK can be used with the MAX function to rank the maximum value in a range of cells.

Example: If you have a list of products and their sales figures, you can use RANK and MAX to rank the product with the highest sales. If the sales figures are in cells D2 to D10, and the product for which you want to find the rank is in cell D5, the formula would be as follows:

=RANK(MAX(D5), MAX(D2:D10))

With MIN

Usage: You can use RANK along with the MIN function to rank the minimum value in a range of cells.

Example: If you have a list of runners and their race times, you can use RANK and MIN to rank the runner with the shortest time. If the times are in cells E2 to E10, and the runner for whom you want to find the rank is in cell E5, the formula would be as follows:

=RANK(MIN(E5), MIN(E2:E10))

For more details on the RANK function, check out the official documentation at the Google Docs Editors Help Center.

More Google Sheets Tutorials
More Microsoft Excel Tutorials
Share This Post
Daniel Smith
Daniel Smith
Daniel Smith is automation consultant with a passion for technology, data, AI, and machine learning.

The Spreadsheet Daddy add-on rebrands to Synterrix. Click here to learn more.

X