To rank data in Excel based on value, use the RANK.EQ function, which assigns a number to a value based on its position relative to a list of other values. For example, if you have a list of sales figures, the highest number can be ranked as 1, the second highest as 2, and so on. This is achieved by selecting the cell you want to rank, specifying the entire range of data to compare it against, and choosing whether you want the ranking to be descending (largest is 1) or ascending (smallest is 1).
What You'll Need
- A computer with Microsoft Excel installed (works in Excel 365, 2021, 2019, 2016, and earlier versions).
- A dataset containing numerical values (such as scores, prices, or quantities) arranged in a column or row.
- An empty column adjacent to your data where the rank numbers will be displayed.
Step-by-Step
- Prepare Your Data: Ensure your numerical values are in a single continuous column. For this guide, assume your values are in cells B2 through B11. Ensure there are no blank cells within this range, as this can sometimes lead to confusing results depending on your version of Excel.
- Select the Rank Cell: Click on the first empty cell where you want the rank to appear (for example, cell C2).
- Enter the RANK.EQ Formula: Type the following formula into the cell:
=RANK.EQ(B2, $B$2:$B$11, 0). Here is a breakdown of what these parts mean:- B2: This is the specific number you are currently ranking.
- $B$2:$B$11: This is the entire range of numbers you are comparing B2 against. The dollar signs ($) are critical; they create an "absolute reference," meaning that when you drag the formula down, Excel will always look at the range B2 to B11 rather than shifting the range downward.
- 0: This is the "order" argument. A 0 (or leaving it blank) tells Excel to rank in descending order, meaning the largest value gets rank 1. If you change this to 1, it will rank in ascending order, meaning the smallest value gets rank 1.
- Press Enter: Once you press Enter, cell C2 will display the rank of the value in B2 relative to the rest of the list.
- Apply the Formula to the Rest of the List: Hover your mouse over the bottom-right corner of cell C2 until the cursor turns into a small black cross (the Fill Handle). Click and drag the Fill Handle down to cell C11. Excel will automatically update the first part of the formula (B2, B3, B4...) while keeping the range ($B$2:$B$11) locked.
- Verify the Results: Check the top and bottom of your list to ensure the highest (or lowest) values have been assigned the correct rank.
Common Mistakes
One of the most frequent errors is forgetting the absolute references (the dollar signs) in the range argument. If you use =RANK.EQ(B2, B2:B11, 0) and drag it down, the second cell will become =RANK.EQ(B3, B3:B12, 0). This means the formula is no longer comparing the value to the whole list, but to a shrinking window of cells, resulting in incorrect ranks.
Another common mistake is attempting to rank non-numerical data. The RANK.EQ function only works with numbers. If your cells contain numbers stored as text (often indicated by a small green triangle in the corner of the cell), the formula will return a #N/A error. You must convert these to numbers using the "Convert to Number" warning or the VALUE function before ranking.
Users also often confuse the "order" argument. It is easy to forget whether 0 is ascending or descending. Remember: 0 = Descending (High to Low), 1 = Ascending (Low to High). If your ranks look "upside down," this is usually the cause.
Tips
Handling Ties: By default, RANK.EQ handles ties by giving them the same rank. For example, if two people both have the highest score of 100, they will both be ranked 1. The next person with a score of 95 will be ranked 3 (skipping rank 2). If you prefer a ranking system that doesn't skip numbers, you may need to use a more complex formula involving the SUMPRODUCT function.
Using Tables: If you convert your data range into an official Excel Table (Insert > Table), your formulas become much easier to manage. Instead of using cell references like $B$2:$B$11, Excel uses structured references like [Sales]. When you add a new row to a table, the rank formula automatically extends to the new row, and the range updates itself without needing manual adjustment.
Combining with Sorting: Ranking provides a number, but it doesn't move the rows. To see your data in order, use the Sort feature. Select your data, go to the Data tab, and choose Sort. Sort by the "Rank" column from Smallest to Largest to see your top performers at the top of the sheet.
Dynamic Ranking with RANK.AVG: If you have many ties and want to avoid the "gap" in ranking (e.g., having two 1s and then a 3), try RANK.AVG. This function assigns the average rank to tied values. In the example of two people tied for 1st, both would be assigned a rank of 1.5.
Troubleshooting
If your formula is returning a #N/A error, the most likely cause is that the value you are trying to rank is not found within the range you specified. Double-check that the first argument (the cell to rank) is actually part of the second argument (the range). Also, ensure there are no hidden characters or spaces in your numbers that might be causing Excel to treat them as text.
If the ranks are all "1", check your absolute references. If you forgot the dollar signs ($), each cell is being compared to a range that starts with itself, making it the "highest" value in its own unique, shrinking range. Undo the fill, add the dollar signs to the range, and drag the formula down again.
If the ranks are not updating when you change a value, ensure that your Calculation Options are set to Automatic. Go to the Formulas tab > Calculation Options > Automatic. If it is set to Manual, Excel will not recalculate the ranks until you press F9.
If you see #VALUE!, check for errors within the data range itself. If any cell in the range B2:B11 contains an error like #DIV/0! or #VALUE!, the RANK.EQ function will fail. You must clean the data or use the IFERROR function to wrap your source data first.
Frequently Asked Questions
What is the difference between RANK and RANK.EQ?
In newer versions of Excel, RANK.EQ is the standard. RANK is an older version kept for compatibility with legacy spreadsheets. They function identically: both assign the same rank to tied values and skip the subsequent rank.
Can I rank data across different sheets?
Yes. In the range argument, instead of B2:B11, you can click over to another sheet and select the range there. The formula will look like =RANK.EQ(B2, Sheet2!$A$2:$A$100, 0).
How do I rank based on multiple criteria?
RANK.EQ only handles one column of values. To rank based on multiple criteria (e.g., rank by Sales, then by Profit for ties), you typically create a "helper column" that combines the two values into one unique number, then rank that helper column.
How do I rank only the top 10 values?
The RANK.EQ function ranks the entire list. To isolate the top 10, use the rank formula first, then apply a Filter (Data > Filter) to the Rank column and select only numbers 1 through 10.
Does the data have to be sorted for the formula to work?
No. The RANK.EQ function works regardless of the order of your data. It looks at the value and compares it to the entire range, no matter where the values are positioned.