Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Formula for Rank in Excel: RANK.EQ and Examples

· 5 min read · Home Tech

In this article
  1. Which Excel rank function should you use?
  2. How to rank a list with an example
  3. Choose descending or ascending order
  4. Handle ties and create unique positions
  5. Common problems and useful checks
  6. Frequently Asked Questions

In Excel for Microsoft 365, use =RANK.EQ(B2,$B$2:$B$10,0) to rank the value in B2 against B2:B10, with the highest value ranked 1. Change the final argument to 1 to rank from lowest to highest; use RANK.AVG instead if tied values should receive their average rank.

Which Excel rank function should you use?

Excel provides two current ranking functions: RANK.EQ and RANK.AVG. Both compare a number with a list of numbers and return its position in that list. The difference matters when values tie.

  • RANK.EQ gives tied values the same rank. The next rank is skipped. If two values tie for first, both are rank 1 and the next value is rank 3.
  • RANK.AVG also gives tied values the same rank, but assigns each the average of the positions they occupy. If two values tie for first, both receive rank 1.5.

The older RANK function remains available for compatibility with earlier Excel workbooks. For new formulas, use RANK.EQ or RANK.AVG so the intended tie behavior is clear.

How to rank a list with an example

Suppose employee names are in A2:A6 and sales figures are in B2:B6: 420, 350, 420, 280, and 390. To rank the first sales figure, enter this in C2:

With sales in B2:B6 and the value to rank in B2, enter =RANK.EQ(B2,$B$2:$B$6,0) in C2. It returns 1, because 420 is the highest value. Copy the formula down through C6 to rank the other figures.

The results are 1, 4, 1, 5, and 3. The two sales figures of 420 share rank 1, so rank 2 is skipped. The value 390 ranks 3, 350 ranks 4, and 280 ranks 5.

The dollar signs in $B$2:$B$6 make the comparison range absolute. When you copy the formula down, the value being ranked changes from B2 to B3 and onward, while the list being ranked stays fixed. Without the dollar signs, the range would shift as the formula is copied.

Choose descending or ascending order

The third argument, called order, controls which end of the list is ranked first:

  • Use 0 or leave the order argument out to rank in descending order: the largest number is 1. This is useful for sales, test scores, and other measures where higher is better.
  • Use 1 to rank in ascending order: the smallest number is 1. This can suit measures such as completion time or cost when a lower value is better.

For example, with times in D2:D10 and the time to rank in D2, =RANK.EQ(D2,$D$2:$D$10,1) returns 1 for the shortest time. The function does not decide whether high or low is desirable; choose the order that matches what the numbers represent.

Handle ties and create unique positions

A rank formula normally gives equal values equal ranks. That is often the fairest result, but it does not produce a unique position for every row. To give tied values their average position, use RANK.AVG.

For a unique sequence such as 1, 2, 3, and so on, add a tie-break rule. One option is to use the row position as the tie-breaker. With scores in B2:B10 and the score to rank in B2, use =RANK.EQ(B2,$B$2:$B$10,0)+COUNTIF($B$2:B2,B2)-1. The first occurrence of a tied score keeps its usual rank; each later occurrence is moved down one place. Copy the formula down. This makes the result dependent on row order, so sort or arrange rows consistently if the tie-break order matters.

For example, if 420 appears twice and the first occurrence is in row 2, the first receives rank 1 and the second rank 2; the next lower score then receives rank 3. If a formal tie-breaker such as date or another score exists, using that rule explicitly is preferable to relying on row order.

Common problems and useful checks

  • Wrong order: If the largest number should be first, make sure the final argument is 0 or omitted. An order of 1 reverses the direction.
  • Moving comparison range: Lock the range with dollar signs before copying the formula. You can select a reference in the formula and press F4 on Windows to cycle through reference styles; on Mac, the shortcut can depend on the keyboard and Excel settings.
  • Numbers stored as text: Values that look like numbers but are stored as text may not rank as expected. Convert them to numeric values, and check for leading apostrophes or imported text.
  • Unexpected gaps in ranks: With RANK.EQ, gaps after ties are normal. Use RANK.AVG for average tied positions, or a tie-break formula if every row needs a distinct position.
  • Blank or nonnumeric cells: A comparison range can include blank cells; they do not count as numeric ranking values. Check that the range contains the intended numbers and that the value being ranked is numeric.
  • Inconsistent ranges: Ensure every formula compares against the same complete set. If new rows are added, extend the range or convert the data to an Excel table so the working range can expand more conveniently.

RANK functions return positions, not sorted data. They do not move rows or change the order of the original list. To display the records in rank order, sort the data by the rank column, or use a separate sorting feature.

Frequently Asked Questions

What is the formula for ranking numbers in Excel?
Use =RANK.EQ(number,ref,order). For example, with values in B2:B10 and the first value in B2, enter =RANK.EQ(B2,$B$2:$B$10,0) to rank the largest number as 1.

How do I rank from lowest to highest?
Set the order argument to 1. With values in B2:B10 and the value to rank in B2, use =RANK.EQ(B2,$B$2:$B$10,1).

How do I rank in Excel without skipping numbers after a tie?
Use a deliberate tie-breaker, such as the row-order formula shown above, or specify another field that decides which tied record comes first. The basic RANK.EQ function skips positions after a tie by design.

What is the difference between RANK.EQ and RANK.AVG?
RANK.EQ assigns tied values the same integer rank and skips subsequent positions. RANK.AVG assigns tied values the average of the positions they would occupy.

Does RANK sort the data?
No. It calculates a rank in a cell but leaves the rows where they are. Sort the records by the rank results if you want to view them in order.