Google Sheets RANK Function: How to Rank Data Easily
In this article
The Google Sheets RANK function determines the position of a specific value relative to a list of other values. It is primarily used to create leaderboards, grade students, or analyze sales performance by assigning a numerical rank (e.g., 1st, 2nd, 3rd) based on whether the highest or lowest value should be the top rank. To use it, you need a value to rank and a range of cells containing the full dataset for comparison.
What You'll Need
- A Google account with access to Google Sheets.
- A dataset containing numerical values (integers, decimals, or currency) arranged in a column or row.
- A designated empty column where the rank results will be displayed.
Step-by-Step
- Prepare Your Data: Ensure your numerical data is organized in a continuous range. For example, if you are ranking sales figures, place the salesperson's name in Column A and their total sales in Column B. Ensure there are no text strings or error messages within the numerical range, as this can interfere with the calculation.
- Select the Target Cell: Click on the first empty cell where you want the rank to appear. If your data starts in cell B2 and ends in B10, you would typically click cell C2 to begin your ranking column.
- Enter the Function Start: Type
=RANK(into the cell. This tells Google Sheets you are initiating the ranking process. - Define the Value (The 'Value' Argument): Click on the cell containing the specific number you want to rank. In our example, this would be cell B2. The formula now looks like
=RANK(B2,. - Define the Range (The 'Reference' Argument): Type a comma, then highlight the entire list of numbers you are comparing the value against. To ensure the rank stays consistent when you drag the formula down, you must use absolute references. Instead of selecting B2:B10, type
$B$2:$B$10. The dollar signs lock the range so it does not shift. The formula now looks like=RANK(B2, $B$2:$B$10,. - Choose the Order (The 'Is_Ascending' Argument): Type another comma and enter either 0 or 1.
- Enter 0 (or leave it blank) for Descending order. This means the largest number is ranked 1. This is standard for sales or test scores.
- Enter 1 for Ascending order. This means the smallest number is ranked 1. This is useful for ranking race times or golf scores.
=RANK(B2, $B$2:$B$10, 0). - Close and Execute: Type the closing parenthesis
)and press Enter. The cell will now display the rank of the value in B2 relative to the range B2:B10. - Apply to the Rest of the List: Click the small blue square (the fill handle) at the bottom-right corner of the cell and drag it down to the bottom of your dataset. Because you used absolute references ($) for the range, Google Sheets will correctly rank B3 against B2:B10, B4 against B2:B10, and so on.
Common Mistakes
One of the most frequent errors is forgetting the absolute references (the dollar signs) in the range argument. If you use =RANK(B2, B2:B10, 0) and drag it down, the next cell becomes =RANK(B3, B3:B11, 0). This shifts the comparison window downward, meaning the function is no longer comparing the value to the full list, leading to incorrect rankings and often returning a rank of "1" for almost every entry.
Another common mistake is trying to rank cells that contain text that looks like numbers. If a number is formatted as "Plain Text" instead of "Number," the RANK function may ignore it or return an error. Always check that your data is formatted correctly via the Format > Number menu.
Users also often confuse the 0 and 1 arguments for order. Remember: 0 is for "High is Best" (Descending) and 1 is for "Low is Best" (Ascending). If your top performer is showing up as rank 10 instead of rank 1, you likely have the wrong order argument selected.
Tips
To handle ties more effectively, consider using the RANK.AVG or RANK.EQ functions. While RANK is the standard, RANK.EQ (Equal) is the modern version that ensures tied values receive the same top rank. For example, if two people tie for 1st, both get 1, and the next person is 3rd. RANK.AVG, however, will average the ranks of tied values; if two people tie for 1st, they both receive a rank of 1.5.
If you want your ranks to update automatically as you add new data, you can use a Named Range. Instead of typing $B$2:$B$10, you can highlight your data, right-click, and select "Define named range," naming it "SalesData." Your formula then becomes =RANK(B2, SalesData, 0), which is much easier to read and manage.
For a more dynamic approach, combine RANK with the SORT function. While RANK tells you the position, it doesn't move the rows. If you want a leaderboard that physically moves the top person to the top of the sheet, you should use the Data > Sort range feature or the =SORT() formula in a separate area of the sheet.
Troubleshooting
If your formula returns a #N/A error, it usually means the value you are trying to rank is not present within the reference range you provided. Double-check that the first argument (the value) is actually a cell located inside the second argument (the range). If you are referencing a value from a different sheet, ensure the range reference includes the sheet name (e.g., 'Sheet1'!$B$2:$B$10).
If the ranks are all the same or seem random, check for hidden characters or spaces in your cells. A cell that looks like "100" but actually contains "100 " (with a trailing space) is treated as text and will be ignored by the RANK function. You can use the =TRIM() function in a helper column to remove these spaces before ranking.
If the formula doesn't update when you change a number, check if your calculation settings are correct. While Google Sheets usually calculates in real-time, ensure you aren't in a filtered view that is hiding the cells you are attempting to edit. Refreshing the browser page is the simplest first step to resolve calculation lags.
Frequently Asked Questions
How does RANK handle ties?
By default, the RANK function assigns the same rank to tied values. If two items tie for 1st place, both are assigned rank 1. The function then skips the next rank; the next highest value will be ranked 3rd, not 2nd.
Can I rank data across multiple columns?
The RANK function requires a single contiguous range. If your data is spread across multiple non-adjacent columns, you must first consolidate that data into one column using a helper column or a formula like ={A2:A10; C2:C10} before applying the RANK function.
Is there a difference between RANK and RANK.EQ?
In Google Sheets, RANK and RANK.EQ perform identically. RANK.EQ was introduced to maintain compatibility with newer versions of Excel, but the logic remains the same: tied values receive the same rank.
Can I rank based on multiple criteria?
The RANK function only supports a single numerical value. To rank based on multiple criteria (e.g., rank by Sales, then by Profit as a tie-breaker), you need to create a "weighted score" in a helper column. For example, =(Sales * 100) + Profit. You then rank that weighted score.
Does the RANK function work with dates?
Yes, because Google Sheets stores dates as numbers behind the scenes. You can use RANK to find the most recent date (Descending, 0) or the oldest date (Ascending, 1) in a list.