transcript

excelisfun - Excel Magic Trick 1135: Rank Values From Two Columns: RANK.AVE, RANK.EQ & RANK Functions

Thumbnail of the video “excelisfun - Excel Magic Trick 1135: Rank Values From Two Columns: RANK.AVE, RANK.EQ & RANK Functions”
Download Markdown
Community upload. AI output has not been independently verified.

Welcome to Excel Magic Trick number 1,135. If you want to download this workbook and follow along, click on the link below the video. Here we have a great example: we have numbers in two separate columns, and these columns are not next to each other, so they are noncontiguous ranges. We need to rank each score in comparison to the numbers in both columns. Our example comes from the sport of boomeranging. We're going to look at the event Maximum Time Aloft, which means you throw your boomerang in the air, and the one that stays in the air the longest wins. We need to rank all of these.

We're going to use the RANK function. Equals RANK, and lo and behold, in our drop-down there are three different functions. In 2010, Microsoft improved many of the statistical functions and added the .AVG and .EQ conventions. RANK.AVG means that if there's a tie, it will average the ranks. RANK.EQ means that if there's a tie for a particular place or ranking, each of the tied values gets the same ranking. The one at the bottom, RANK, is the compatibility function. That little yellow triangle indicates it works exactly like RANK.EQ. Microsoft wants you to use the new ones, but the compatibility function is there in case you have older spreadsheets that use RANK. Other statistical functions Microsoft added in 2010 that use this dot convention include the normal distribution functions and the percentile functions. The idea is that they improved many of the old statistical functions.

For this example, we're going to use RANK.AVG. I'll hit Tab. This function wants the number first, so I'll click that number, then type a comma and the reference. Normally we highlight any range we want, and it goes into the reference argument. But we have two ranges, so check this out: you type an open parenthesis and highlight the first range. We need to lock it, so I'll hit F4. Then a comma, then highlight the second range and hit F4 again, and close the parenthesis. Many statistical functions that take a reference will handle multiple ranges this way, using open parentheses, commas between ranges, and a close parenthesis.

We come to the last argument, the order. Descending, or zero, means the biggest gets first place. One, or ascending, means the smallest gets first place. Since this is Maximum Time Aloft, we want zero. Close the parentheses, press Ctrl+Enter, double-click the fill handle, and send it down. Then Ctrl+C, click over here, and Ctrl+V, and instantly we have our ranking. Notice Tim got first place with the longest time, 76.48 seconds, a long Maximum Time Aloft throw. There was a tie: Phil and Kip both had 31.8 seconds, so they tied. Instead of getting 14 and 15 like RANK.EQ would give, we get the average of the two: 14 plus 15 divided by two, which is 14.5. If we look through the list, there is no 15; the next rank is 16.

Now let's look at the next example, and we'll do it a little differently to see some other tricks in addition to RANK.EQ. Instead of entering the formula here and copying it down and over, I'll highlight the entire range, then hold the Control key and select the second range. Now we have an active cell, and whatever formula we put in that cell in Edit mode, when we press Ctrl+Enter, will populate all of the highlighted cells. So, are you ready? Equals RANK, and this time we'll use RANK.EQ, because we want 14th place to go to both people, so both get 14. We start with the number. Check this out: these are noncontiguous ranges, and the number is a relative cell reference two cells to my left. When I press Ctrl+Enter and populate everything, the formula will automatically look two cells to my left. Comma, then the reference: open parenthesis, F4 to lock the first range, comma, F4 to lock the second range, close parenthesis, comma. We still want the biggest to get first, so we enter zero and close the parenthesis. When I press Ctrl+Enter, it populates all the way through. If I go into Edit mode with F2, the ranges are locked, but the relative reference is looking one or two cells to my left. Notice that Kip and Phil now both get 14. There's no 15; it goes straight to 16.

Over here, I'll not bore you with the repeat, but to show that RANK and RANK.EQ are the same, I completed this formula with the compatibility function, then used Ctrl+Enter to populate it all the way through. Sure enough, there's our relative cell reference, our locked references, and Kip and Phil both get 14. In the old days, all we had was RANK, so if we wanted to average the scores, we had to write pretty fancy formulas. For the boomerang events, you want to average the ties, so the RANK.AVG version up here would be the correct one for scoring. It depends on the system and how you want to rank, of course, and there are other ways to rank besides these two.

One last event: Boomerang Fast Catch. That's where you throw five times as fast as you can, and the boomerang has to come back after going 20 meters. There are some great scores here, but let's highlight our range and enter =RANK.AVG, since that's how Boomerang scoring works. This time we'll use keyboard shortcuts to get our cell references. The number is Left Arrow, Left Arrow, comma, then an open parenthesis. The first range is Left Arrow, Left Arrow, Control+Shift+Down Arrow, F4, comma. Then Left Arrow, Left Arrow, Control+Shift+Down Arrow, F4, close parenthesis, comma. This is Fast Catch, so the smallest time wins, and we use one, then close the parenthesis. Control+Enter populates all the way through. Alice had an awesome Fast Catch time: she threw five boomerangs that went out 20 meters and came back in 18.3 seconds. Barbara is second. There are some amazing scores here; anything under 20 seconds with a little wind is pretty impressive. Here's our tie: Tim, Phil, and Sue all tied with 25.4 for seventh place. So the next places go seven, eight, nine, and the next one should be ten, and there it is. There's no eight or nine ranking anywhere in our list.

That was a lot of fun with ranking. We saw the three different ranking functions, and we saw how to use the reference argument to reference columns that are not next to each other. We'll see you next trick.