Find Top 10 Unique Names by Score in Google Sheets

Published on

In several scenarios, you might need to find the top 10 unique names by the score in Google Sheets. This is commonly used in sports rankings, gaming leaderboards, and academic competitions where multiple attempts exist. The goal is to ensure that each participant appears only once, with their highest score considered.

You can achieve this using either a combination of SORT and SORTN or the QUERY function.

How to Find the Top 10 Unique Names by Score in Google Sheets

Formula Option 1: Using SORT and SORTN

=SORT(SORTN(SORT(A2:B, 2, FALSE), 10, 2, 1, TRUE), 2, FALSE)

Formula Option 2: Using QUERY

=QUERY(A2:B, "select Col1, max(Col2) group by Col1 order by max(Col2) desc limit 10 label max(Col2)''")

When using these formulas, replace A2:B with your actual data range, where column A contains names and column B contains scores.

Google Sheets Example: Find Top 10 Unique Names by Score

Sample Data

Sample data of player names and scores for top 10 unique names by score

In the sample data, column A contains player names, and some players appear multiple times. In such cases, only their highest score should be considered.

Applying the Formula

To display the top 10 unique players by score, enter one of the formulas above in D1 (if columns D and E are empty). The results will populate in D1:E10.

Example: Find top 10 unique names by score in Google Sheets

How the Formula Works

Below is an explanation of how both formulas work. They are simple to understand—let’s dive in!

SORT + SORTN Method

  1. SORT(A2:B, 2, FALSE): Sorts the scores in descending order (highest to lowest).
  2. SORTN(..., 10, 2, 1, TRUE): Selects top 10 unique names, keeping only their highest score.
  3. SORT(..., 2, FALSE): Ensures the results remain sorted by score.

QUERY Method

  1. group by Col1: Groups rows by player names (removes duplicates).
  2. max(Col2): Extracts each player’s highest score.
  3. order by max(Col2) desc limit 10: Sorts scores in descending order and selects the top 10.
  • As a side note, between the two functions, I prefer the powerful SORT and SORTN combo over QUERY, as it performs better. QUERY processes structured queries similar to SQL, which can slow performance when working with very large datasets or applying multiple queries to the same dataset.

How to Find the Top 5 Unique Names by Score

If you need the top 5 instead of the top 10:

  • In SORTN, replace 10 with 5.
  • In QUERY, replace limit 10 with limit 5.

Example: =SORT(SORTN(SORT(A2:B, 2, FALSE), 5, 2, 1, TRUE), 2, FALSE)

That’s it! You can now easily find the top unique names based on score in Google Sheets.

FAQ: Common Questions About Ranking in Google Sheets

How do I rank without duplicate names in Google Sheets?

Use SORTN or QUERY with MAX(B) to remove duplicates and keep only the highest score.

Can I find the top 10 without using QUERY?

Yes! Use SORTN(SORT(A2:B,2,FALSE),10,2,1,TRUE) to get the top 10 unique names by score.

How do I assign ranks after finding the top 10?

You can use the RANK.EQ or RANK.AVG functions alongside the formulas above. For example, after clearing F1:F, enter the following formula in cell F1.

=ArrayFormula(IFNA(RANK.EQ(E1:E, E1:E)))

Resources

Prashanth KV
Prashanth KV
Your Trusted Google Sheets and Excel Guide Prashanth KV brings a wealth of experience in Google Sheets and Excel, cultivated through years of work with multinational corporations in Mumbai and Dubai. As a recognized Google Product Expert in Docs Editors, Prashanth shares his expertise through insightful blogging since 2012. Explore his blog for practical tips and guidance on maximizing your spreadsheet skills.

Cycle Highlights in Google Sheets – Rotate Highlights Daily

Want to cycle highlights in Google Sheets every day? Whether you're rotating a meal...

Filter Rows Containing Multiple Selected Values in Google Sheets

This tutorial explains how to filter rows in a column containing multiple selected drop-down...

Two-Way Lookup with XLOOKUP in Google Sheets

When you need to look up one search key vertically and another horizontally, you...

How to Filter by Total in Google Sheets Pivot Tables

Google Sheets offers many tools to summarize and analyze data, but Pivot Tables are...

More like this

Cycle Highlights in Google Sheets – Rotate Highlights Daily

Want to cycle highlights in Google Sheets every day? Whether you're rotating a meal...

Filter Rows Containing Multiple Selected Values in Google Sheets

This tutorial explains how to filter rows in a column containing multiple selected drop-down...

Two-Way Lookup with XLOOKUP in Google Sheets

When you need to look up one search key vertically and another horizontally, you...

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.