Example 1
Rank a sales figure, highest first
C2 =RANK.EQ(B2,$B$2:$B$8)
Result: 3
Only Priya (62,000) and Ana (56,300) sold more than Ines, so Ines is third. Fill the formula down to rank everyone.
C2 =RANK.EQ(B2,$B$2:$B$8) returns 3
Returns the rank of a number within a list: 1 for the largest by default, or 1 for the smallest. Tied values share the top rank.
Syntax
=RANK.EQ(, , )
Excel 2010 and later, including Excel for Microsoft 365 and Excel for the web. The older RANK function works in every version.
Try it
Edit the formula in C2 or change the inputs. The sheet recalculates as you type.
C2 =RANK.EQ(B2,$B$2:$B$8) returns 3
RANK.EQ tells you where a value stands in a list. Use it for league tables, "top 10" lists, sales rankings, and flagging which rows are in the bottom quartile.
RANK.EQ compares the value in number with every number in ref and returns its position.
order, or use 0.order to 1 and the smallest value is rank 1. Use this when low is good, such as defects, lap times or costs.You do not need to sort the list. RANK.EQ gives the same answers whatever order the rows are in, so you can rank a table without rearranging it.
If two values are equal, RANK.EQ gives both the same rank, the higher of the positions they share. The next value then skips a number. For scores of 90, 85, 85 and 70, the ranks are 1, 2, 2 and 4: there is no rank 3. If you need ties to share an average rank such as 2.5, use RANK.AVG. If you need to break ties so every row has a unique rank, add a tie-breaker: =RANK.EQ(B2,$B$2:$B$8)+COUNTIF($B$2:B2,B2)-1 ranks equal values in the order they appear.
The most common mistake is forgetting the dollar signs. Written =RANK.EQ(B2,B2:B8) and filled down, the range slides to B3:B9, B4:B10, and the ranks become wrong from the second row on. Write the reference as $B$2:$B$8 so every row ranks against the whole list.
RANK.EQ was added in Excel 2010. It behaves exactly like the older RANK function, which still works and is kept for compatibility. The newer name makes it clear that tied values get an equal rank, and sits alongside RANK.AVG. Use RANK.EQ in new workbooks. If a file has to open in Excel 2007 or earlier, use RANK.
RANK.EQ has no condition, so it ranks everything in the list together. To rank within a group, such as per region, use COUNTIFS: =COUNTIFS($A$2:$A$8,A2,$B$2:$B$8,">"&B2)+1. RANK.EQ cannot rank text, and returns #N/A if the value is not in the list.
The reverse question, "which value has rank 3?", is answered by LARGE and SMALL.
B2. It must appear in ref, or the result is #N/A.$B$2:$B$8. Lock it with dollar signs when you fill the formula down. Text and blanks are ignored.0 or omitted ranks from the largest down, so the biggest value is 1. Any other number, such as 1, ranks from the smallest up, so the smallest value is 1.Each example is a live sheet. Change the inputs or the formula and watch the result.
Example 1
C2 =RANK.EQ(B2,$B$2:$B$8)
Result: 3
Only Priya (62,000) and Ana (56,300) sold more than Ines, so Ines is third. Fill the formula down to rank everyone.
C2 =RANK.EQ(B2,$B$2:$B$8) returns 3
Example 2
C2 =RANK.EQ(B2,$B$2:$B$6,1)
Result: 4
With order 1, the fastest time ranks first. R1's 12.4 seconds is the fourth fastest.
C2 =RANK.EQ(B2,$B$2:$B$6,1) returns 4
Example 3
C5 =RANK.EQ(B5,$B$2:$B$5)
Result: 4
S2 and S3 both rank 2, so there is no rank 3. The next score, 70, ranks fourth.
C5 =RANK.EQ(B5,$B$2:$B$5) returns 4
Example 4
B7 =RANK.EQ(75,B2:B5)
Result: #N/A
RANK.EQ only ranks values that appear in the list. 75 is not there, so the result is #N/A.
B7 =RANK.EQ(75,B2:B5) returns #N/A
Solve it in the sheet. Every answer is checked, with hints if you need them.
Task 1 of 2
In C2, rank Ines's sales against all the reps, with the highest sales ranked 1. Fill the formula down to C8.
Answer in C2, then it fills down to C8.
$ on the list. RANK.EQ(B2,B2:B8) filled down becomes B3:B9, B4:B10 and the ranks drift. Write $B$2:$B$8.#N/A means the number is not in the list. This happens when a value is rounded differently or stored as text. Use cell references rather than typed numbers.order argument is easy to flip. Omitted or 0 puts the largest first; any other number puts the smallest first.They give the same results. RANK.EQ is the current name, introduced in Excel 2010, and RANK is kept for compatibility with older files. Use RANK.EQ in new work.
With ties, RANK.EQ gives every tied value the top rank (1, 2, 2, 4). RANK.AVG gives them the average of the ranks they share (1, 2.5, 2.5, 4).
Add a tie-breaker: `=RANK.EQ(B2,$B$2:$B$8)+COUNTIF($B$2:B2,B2)-1`. Equal values are then ranked in the order they appear.
Set the third argument to 1: `=RANK.EQ(B2,$B$2:$B$8,1)`.
Count the values in the same group that are bigger, and add 1: `=COUNTIFS($A$2:$A$8,A2,$B$2:$B$8,">"&B2)+1`.
RANK.EQ is taught in Data analysis with formulas, lesson 17: RANK and ranking within groups. Each lesson is a short, graded exercise like the one above.