# How to rank with a tiebreaker in Excel

Rank on the main column, then add the number of tied rows that win on the second: `=RANK.EQ(B2,$B$2:$B$7)+COUNTIFS($B$2:$B$7,B2,$C$2:$C$7,">"&C2)`.

**Excel:** `=RANK.EQ(B2,$B$2:$B$7)+COUNTIFS($B$2:$B$7,B2,$C$2:$C$7,">"&C2)` (Excel 2010 and later)

**Google Sheets:** the same formula works.

## Example

Sample data (row 1 is the header):

| A | B | C | D |
| --- | --- | --- | --- |
| Team | Points | Goal difference | Position |
| Rovers | 21 | 8 |  |
| United | 24 | 5 |  |
| City | 21 | 12 |  |
| Athletic | 18 | 3 |  |
| Wanderers | 24 | 9 |  |
| Town | 15 | -4 |  |

Formula in D2, filled to D7: `=RANK.EQ(B2,$B$2:$B$7)+COUNTIFS($B$2:$B$7,B2,$C$2:$C$7,">"&C2)`

Result: 4; 2; 3; 5; 1; 6

## How it works

RANK.EQ gives United and Wanderers both 1st on 24 points. COUNTIFS then counts teams with the same points and a better goal difference: none for Wanderers, one for United, so United moves to 2nd. Rovers and City are separated the same way.

## Other ways

- `=COUNTIF($B$2:$B$7,">"&B2)+COUNTIFS($B$2:$B$7,B2,$C$2:$C$7,">"&C2)+1`: Without RANK.EQ: teams with more points, plus tied teams with a better goal difference, plus one.
- `=RANK.EQ(B2,$B$2:$B$7)`: Points only. (Teams on equal points share a position: 3, 1, 3, 5, 1, 6.)

## Common mistakes

- Teams equal on both points and goal difference still share a position. Add a third test, like goals scored, if you need every rank unique.
- Use `">"` for a tiebreaker where higher is better and `"<"` where lower is better, like time taken.

## Questions

**How do I add a third tiebreaker?**

Add another COUNTIFS for rows tied on both: `+COUNTIFS($B$2:$B$7,B2,$C$2:$C$7,C2,$E$2:$E$7,">"&E2)`.

**How do I sort the table by position?**

In Excel 365: `=SORTBY(A2:C7,D2:D7,1)`.

Every formula and result on this page was checked by running it in the Spreadsheet Practice formula engine on 2026-10-30.

Source: https://spreadsheetpractice.com/formulas/rank-with-a-tiebreaker
