How to Rank Text Uniquely in Google Sheets

Are you tired of the same old ranking formulas that give duplicate ranks to identical text values in Google Sheets? Well, worry no more! I have a solution for you that will help you rank text values uniquely, without any duplicates.

The Problem with Duplicate Ranks

Let’s say you have a list of items, and some of them are repeated. Using traditional ranking formulas would assign the same rank to each duplicate text value. For example, if “apple” appears twice and is ranked as #1 in the list, both instances of “apple” would also get the rank #1. This can affect the ranking of other text values in the list.

Introducing a Unique Ranking Formula

To solve this problem, I have come up with a combination of two conditional count functions in Google Sheets – Countif and Countifs. These functions allow us to rank text values uniquely, taking into account both the count of text values below and the running count of text values in the list.

The Magic Formula

The generic formula to rank text values uniquely in Google Sheets is as follows:

Unique Rank of Text = Count_of_Text_Below + Running_Count_of_Text

Let’s break down the formula into its individual components:

Count_of_Text_Below – This represents the number of texts that are less than the text in question. In other words, it calculates how many items are below a certain text value in the list.

Running_Count_of_Text – This calculates the running count of a particular text value in the list. It increases by 1 for each occurrence of the text.

By combining these two components, we can determine the unique rank of each text value in the list.

Examples and Visuals

To better understand how this formula works, let’s take a look at two scenarios – an unsorted list and a sorted list:

Unsorted (Randomized) List:
Rank Text Uniquely in an Unsorted List

Sorted List:
Rank Text Uniquely in a Sorted List

As you can see, the unique ranks are assigned based on the count of text values below and the running count of text values.

Implementation in Google Sheets

Now, let’s see how to implement this formula in Google Sheets.

Drag-down Formula

If your list is sorted or unsorted, you can use the following drag-down formula:

=COUNTIF($B$2:$B,"<"&B2)+COUNTIF($B$2:B2,B2)

Simply insert this formula in cell C2 and copy-paste it down as far as needed. The formula takes into account both the count of text values below and the running count of text values to give you the unique rank for each text value.

Array Formula

Alternatively, you can use an array formula that incorporates both COUNTIF and COUNTIFS functions. Here is the array formula for ranking text values uniquely:

=ArrayFormula(if(B2:B="",, COUNTIF(B2:B,"<"&B2:B)+ COUNTIFS(B2:B,B2:B,row(B2:B),"<="&ROW(B2:B))))

This formula works even if the list is unsorted. The output is limited to non-blank rows using the if function.

Conclusion

And there you have it! Now you know how to rank text values uniquely in Google Sheets using a combination of conditional count functions. Say goodbye to duplicate ranks and hello to a more accurate and reliable ranking system.

For more Google Sheets tips and tricks, visit Crawlan.com. Stay tuned for more juicy secrets shared exclusively for our besties like you!

Related posts