Collaboration Microsoft Software

How to calculate rank in an Excel sheet

vector of XLS icon with landscape design . spreadsheet format file with download button. digital sheet. data processing application.
Image: Ahmad/Adobe Stock

As a baby of the darkish ages, I used the phrase rank to describe one thing that smelled rotten or suspicious. Rank in Microsoft Excel is, fortunately, completely completely different. In Excel, rank is a price that represents the place of 1 worth inside a gaggle of values. You’ll need to rank every kind of information: scholar GPAs, sport statistics, product gross sales and so forth. In this text, I’ll present you the way to use Excel’s three rating features.

SEE: Google Workspace vs. Microsoft 365: A side-by-side evaluation w/guidelines (TechRepublic Premium)

I’m utilizing Microsoft 365 on a Windows 10 64-bit system. You can use Excel’s RANK() in any model. RANK.AVG and RANK.EQ() have been added to Excel 2010 (.xlsx). I’m together with demonstration recordsdata for each the .xlsx and .xls codecs, however solely RANK() will work in variations sooner than Excel 2010. Excel for the net helps all three rating features, for now.

How to use Excel’s RANK() operate

Excel’s oldest rating operate, RANK() has been roughly changed by extra correct features, which we’ll take a look at later. For now, let’s take a look at RANK() to be complete.

Excel’s RANK() operate returns the rank of a numerical worth inside an inventory of different numerical values and makes use of the next syntax:

RANK(quantity, ref, [order])

An clarification of the three arguments follows:

  • Number is required and identifies the quantity you need to rank.
  • Ref is required and references a variety of cells that comprise the numerical values associated to quantity.
  • Order is the one elective argument and identifies how to rank quantity:
    • 0 is the default and may be omitted: ranks in descending order.
    • Any nonzero numerical worth ranks ref as if is sorted in ascending order.

Now that you understand the fundamentals, you ought to be conscious of some attention-grabbing behaviors.

When rating a set of values, you want to understand how RANK() handles duplicate numbers: RANK() returns the identical rating worth for every. That, for higher or worse, impacts the rating of subsequent numbers as a result of Word’s RANK() received’t skip a returned rank worth. For instance, in an ascending record, if the quantity 120 happens twice and the rank of each is 8, the subsequent rating worth will return 10, not 9. This rating habits makes good sense, however it would possibly throw you a bit while you view the outcomes. You can add a correction issue, however it isn’t a part of the RANK() operate itself, so I received’t introduce it right here.

Now, let’s take a look at the easy record of article titles and the variety of occasions every article was considered proven in Figure A. (The numbers have been generated by a RANDBETWEEN() operate and are not true values.) To return the rank of every variety of views inside the similar record, enter the next in D3:


If you’re not working with a Table object, use the next:


Figure A

Let’s use RANK() to find the most popular and least popular articles.
Let’s use RANK() to discover the preferred and least standard articles.

To get one of the best viewing expertise, kind by the rating values in column D, as proven in Figure B.

Figure B

Sorting gives you the best picture of the ranked results.
Sorting provides you one of the best image of the ranked outcomes.

Remember, in rating phrases, the decrease the worth the larger the rank. For occasion, the article How to spell web page numbers as an alternative of utilizing digits in a page-numbering scheme had the best variety of views, 5,963, and ranks first.

There aren’t any duplicates in the present record, so let’s modify a few the view numbers. Figure C reveals the brand new outcomes.

Figure C

Duplicate values return the same rank.
Duplicate values return the identical rank.

The titles in rows 5 and 6 are tied for third place. The titles in rows 9 and 10 are tied for seventh place. And true to our earlier dialogue the ranks of fourth and eighth aren’t assigned, visually.

Now, let’s transfer on to the newer rating features.

How to use Excel’s RANK.AVG() operate

In virtually each means, Excel’s RANK.AVG() operate performs as RANK(), besides in a technique: RANK.AGE() returns an common rank if a quantity happens greater than as soon as. The syntax is precisely the identical, so enter the next operate in E3 to see the way it compares to the outcomes of the older RANK() operate:


As you may see in Figure D, the returned rank for the primary tie is 3.5—the common of the 2 rating values. If there may be one duplicate, that means two values, this operate will add .5 to the rank.

Figure D

Word’s RANK.AVG() better accommodates duplicates.
Word’s RANK.AVG() higher accommodates duplicates.

If there are two duplicates, that means three values, RANK.AVG() rounds up to the subsequent rank and removes the ranks earlier than and after. Figure E reveals an instance of this in rows 4 by 8.

Figure E

The average rank increase with every duplicate.
The common rank improve with each duplicate.

The worth 5,604 happens thrice, so the common rank, 3.5 is rounded to 4. Notice that the ranks of two and 5 are lacking above and under the three occurrences of 5,604.

An common rank won’t be what you want, so let’s overview the final of Excel’s rating operate, RANK.EQ().

How to use Excel’s RANK.EQ()

Excel’s RANK.AVG() corrects for duplicate values by returning the common rank. Suppose you don’t need the common, however relatively, the highest rank of the repeated values—comparable to RANK(). In reality, RANK.EQ() is RANK(). With the addition of RANK.AVG(), the title RANK.EQ() is extra constant in construction than the earlier-named RANK().

RANK.EQ() makes use of the identical syntax, so let’s go straight to an instance. As you may see in Figure F, this operate returns the identical rating values as RANK()by assigning the identical rank for duplicate numbers.

Figure F

Excel’s RANK.EQ() replaces RANK().
Excel’s RANK.EQ() replaces RANK().

RANK() remains to be round for backward compatibility solely. You don’t want to replace present RANK() features (no less than not but) however use RANK.EQ() going ahead.

Stayed tuned

In our easy instance, the info construction of the Excel knowledge simplifies our rating job as a result of there aren’t any circumstances. In a future article, I’ll present you the way to deal with rating when a situation should be evaluated.


Leave a Reply

Your email address will not be published.Required fields are marked *