Google Sheets RANK.AVG Function: A Complete Guide
In this article
The RANK.AVG function in Google Sheets determines the rank of a specific value within a dataset and returns the average rank when there are ties. For example, if two people tie for 1st place, instead of both being ranked 1 or both being ranked 2, RANK.AVG assigns them both a rank of 1.5. This is essential for statistical accuracy in competitions, grading, or financial analysis where ties must be handled mathematically rather than arbitrarily.
What You'll Need
- A Google account with access to Google Sheets.
- A dataset containing a list of numbers (scores, sales figures, prices, etc.) that you wish to rank.
- A basic understanding of cell references (e.g., A2, B10).
Step-by-Step
- Prepare Your Data: Ensure your numbers are in a single column or row. For this guide, assume your numbers are in cells A2 through A11. Ensure there are no text strings or empty cells within the range that could interfere with the calculation.
- Select the Target Cell: Click on the cell where you want the rank to appear. Usually, this is in the column immediately to the right of your data (e.g., cell B2).
- Enter the Function Start: Type
=RANK.AVG(into the cell. This tells Google Sheets you are starting a rank calculation that averages tied positions. - Define the Value: Click on the specific cell you want to rank. If you are in cell B2 and want to rank the value in A2, click A2. Your formula should now look like
=RANK.AVG(A2,. - Define the Range: Enter a comma, then highlight the entire list of numbers you are comparing the value against. In our example, highlight A2 through A11.
- Lock the Range: To ensure the formula works when you drag it down, you must use absolute references for the range. Press F4 on your keyboard or manually add dollar signs to the range:
$A$2:$A$11. The formula should now be=RANK.AVG(A2, $A$2:$A$11,. - Choose the Sort Order (Optional): Enter another comma followed by either 0 or 1.
- 0 (or omitted): Descending order. The largest number gets the rank of 1. This is standard for test scores or sales.
- 1: Ascending order. The smallest number gets the rank of 1. This is standard for race times or golf scores.
- Complete and Execute: Close the parenthesis
)and press Enter. For a descending rank of A2, the final formula is=RANK.AVG(A2, $A$2:$A$11, 0). - Apply to All Rows: Click the small blue square (fill handle) at the bottom-right corner of cell B2 and drag it down to B11. Google Sheets will automatically update the target cell (A2, A3, A4...) while keeping the range locked.
Common Mistakes
One of the most frequent errors is forgetting to use absolute references (the dollar signs) for the range. If you use A2:A11 instead of $A$2:$A$11, the range will shift downward as you drag the formula. For example, in row 3, the formula would look at A3:A12, meaning the first item in your list is no longer being considered, and the rank will be mathematically incorrect.
Another common mistake is confusing RANK.AVG with RANK.EQ. While both functions return the same result for unique numbers, they differ during ties. RANK.EQ (Equal) gives all tied items the top rank in the tie (e.g., two people tie for 1st, both get 1, and the next person is 3rd). RANK.AVG gives the average (e.g., two people tie for 1st, both get 1.5, and the next person is 3rd). Using the wrong one can skew your data analysis if you are calculating a mean rank across a population.
Users also often mistakenly include the header row in their range. If your range is A1:A11 but A1 is the word "Score," Google Sheets generally ignores the text, but it is a poor practice that can lead to errors in more complex nested formulas. Always start your range at the first actual numerical value.
Tips
To make your ranking sheet more readable, use Conditional Formatting. Highlight your rank column, go to Format > Conditional formatting, and apply a color scale. This allows you to visually identify the top and bottom performers instantly without reading every single number.
If you have a massive dataset that changes frequently, consider using the ARRAYFORMULA wrapper. While RANK.AVG doesn't natively support arrays in a simple way, you can combine it with other functions or use a helper column to automate the ranking process so you don't have to manually drag the formula down every time you add a new row of data.
For those who need to rank data based on multiple criteria (e.g., rank by score, then rank by time if scores are tied), RANK.AVG alone is not enough. You will need to create a "tie-breaker" column where you add a very small fraction of the second criteria to the first criteria before applying the RANK.AVG function.
Troubleshooting
The formula returns #N/A: This typically happens if the value you are trying to rank is not found within the specified range. Double-check that your target cell (the first argument) is actually one of the cells inside the range (the second argument). If you are referencing a value from a different sheet, ensure the value is exactly identical, including hidden decimals.
The ranks are all the same: Check your range references. If you forgot the dollar signs ($), the range is moving as you drag the formula. By the time you reach the bottom of your list, the formula might only be comparing the last cell to itself, resulting in a rank of 1 for every entry.
The rank is a decimal I didn't expect: Remember that this is the "Average" rank function. If you see a .5, it means there is a tie. If you see a .33 or .66, it means there is a three-way tie. If you want whole numbers only, you should use the RANK.EQ function instead.
The rankings are backwards: You likely have the sort order argument set incorrectly. If the smallest number is being ranked #1 but you want the largest number to be #1, change the third argument from 1 to 0 (or remove it entirely, as 0 is the default).
Frequently Asked Questions
What is the difference between RANK.AVG and RANK?
The original RANK function is older and behaves similarly to RANK.EQ. RANK.AVG was introduced to provide a specific way to handle ties by averaging the ranks they would have occupied. For example, in a tie for 2nd and 3rd place, RANK.AVG assigns 2.5 to both.
Can I use RANK.AVG on text?
No, RANK.AVG only works with numerical values. If you try to rank a range containing text, the function will ignore the text cells. If the target value itself is text, the function will return an error.
How do I rank in ascending order?
To rank in ascending order (where the lowest value is #1), set the third argument of the function to 1. The formula would look like =RANK.AVG(A2, $A$2:$A$11, 1).
Does RANK.AVG update automatically?
Yes. Because it is a dynamic formula, if you change a value in your data range, all affected ranks will recalculate instantly to reflect the new order.
Can I rank data across different sheets?
Yes. You can reference a range on another sheet by including the sheet name. For example: =RANK.AVG(A2, 'DataSheet'!$A$2:$A$100, 0).
Why is my rank 1.5 instead of 1?
A rank of 1.5 indicates a tie for the first position. Since two items are tied for 1st and 2nd place, the function averages those positions (1+2)/2 = 1.5.