Table of Contents
Mastering Conditional Ranking in Google Sheets
Calculating rank in a spreadsheet is straightforward, but data analysis often requires conditional ranking—determining a value’s position relative only to a specific subset of data. Since Google Sheets does not feature a dedicated `RANKIF` function, advanced users must combine the native RANK function with the powerful FILTER function. This synergy allows you to dynamically create the exact array you wish to rank against, effectively simulating a conditional ranking mechanism.
This guide provides expert methods for constructing robust conditional ranking formulas, ensuring your rankings are accurate and highly specific to the criteria you define. We will explore two primary structures: ranking based on a single condition and ranking based on multiple, simultaneous conditions. Understanding how the FILTER function creates a temporary, relevant dataset is key to mastering this technique.
The methods below illustrate the core syntax required to implement a RANK IF solution in your worksheets. We will then proceed with practical examples using real-world data to demonstrate the efficiency and flexibility of these combined functions.
Method 1: Implementing RANK IF with a Single Criterion
The simplest form of conditional ranking requires matching data points against one criterion. By nesting the FILTER function inside the RANK function, we instruct Google Sheets to first isolate a specific subset of data based on a column condition, and then calculate the rank of the target cell only within that filtered group. This is essential when analyzing performance within segregated categories, such as ranking sales figures only for a specific region.
The following structure outlines the syntax for ranking based on a single condition. Note the use of absolute column references to ensure the range remains static when the formula is dragged down across rows, while the target cell reference (C1 in this schematic) should generally be relative to adjust row by row.
=RANK(C1, FILTER(A:C, A:A="string"))
In this formula, the FILTER(A:C, A:A=”string”) component executes first. It looks across the entire dataset (columns A through C) and returns only the rows where the value in column A exactly matches the designated “string” value. The RANK function then takes the value from cell C1 and compares it against the third column of this newly created, filtered dataset. This means the formula finds the rank of the value in cell C1 among all values in column C where the corresponding value in column A is equal to “string.”
Method 2: Implementing RANK IF with Multiple Criteria
For more granular analysis, you often need to rank data based on the intersection of two or more criteria. Fortunately, the FILTER function naturally handles multiple conditions by separating each condition with a comma. When multiple criteria are provided this way, Google Sheets applies an implicit AND logic, meaning a row must satisfy *all* specified conditions to be included in the filtered array used for ranking.
This method is invaluable for scenarios such as ranking employee productivity only within a specific department AND during a specific quarter, offering highly precise statistical insight.
=RANK(C1, FILTER(A:C, A:A="string1", B:B="string2"))
The key difference here is the inclusion of the second logical test: B:B=”string2″. The FILTER function now only passes rows to the RANK function if column A matches “string1” AND column B matches “string2.” This refinement ensures that the rank calculated for the value in cell C1 is highly specific. This formula finds the rank of the value in cell C1 among all values in column C where the corresponding value in column A is equal to “string1” and the value in column B is equal to “string2.”
Practical Example 1: Ranking Based on One Condition
To illustrate these methods, consider a dataset containing player statistics, including Team (Column A), Position (Column B), and Points (Column C). Our goal is to calculate the rank of points scored, but only among players belonging to the “Mavs” team, ignoring all other teams. This requires applying Method 1.
Here is the dataset we will be working with in Google Sheets:

We apply the following formula, starting in cell D2 and dragging it down the column, to calculate the rank of the points values for only the rows where the team is specified as “Mavs”:
=RANK(C2, FILTER(A:C, A:A="Mavs"))
The C2 reference ensures that as the formula is dragged down, each player’s score is individually compared against the full filtered list of “Mavs” scores. The following screenshot demonstrates the practical application and resulting ranked values:

It is important to remember that in the RANK function, a rank of 1 indicates the largest value (highest score). Based on the output above, here is how to accurately interpret the conditional rank values:
- The Guard on the Mavs team with 21 points has the 3rd highest points value among all players on the Mavs.
- The Guard on the Mavs team with 14 points has the 5th highest points value among all players on the Mavs.
You will observe that a #N/A value was produced for each of the Spurs players. This occurs because the formula specified that we only want to provide a ranking for players on the “Mavs” team. When the formula runs for a “Spurs” row, the FILTER function returns an empty range (because no “Spurs” data is filtered), and the RANK function cannot operate on an empty range, resulting in the error.
Practical Example 2: RANK IF with Multiple Criteria
Building on the previous example, let us now refine our ranking to be even more specific. We want to calculate the rank of points scored, but only for players who meet two conditions: they must be on the “Mavs” team AND they must play the “Forward” position. This requires the application of Method 2, utilizing two criteria within the FILTER function.
We can use the following formula, again starting in cell D2, to calculate the rank of the points values for the rows that satisfy both the team and position requirements simultaneously:
=RANK(C2, FILTER(A:C, A:A="Mavs", B:B="Forward"))
The inclusion of the second condition, B:B=”Forward”, drastically narrows the virtual dataset passed to the RANK function. This ensures that a player’s score is only ranked against other “Mavs” players who are also “Forwards.”
The following screenshot illustrates how this refined syntax impacts the resulting ranking column:

Notice that rows which failed either the team or the position test now display the #N/A error. Focusing solely on the successful ranks, here is how to interpret the results:
- The Forward on the Mavs team with 19 points has the 3rd highest points value among all players on the Mavs who are Forwards.
- The Forward on the Mavs team with 32 points has the 1st highest points value among all players on the Mavs who are Forwards.
This demonstrates the power of combining RANK and FILTER to perform sophisticated, conditionally restricted calculations in Google Sheets. Any player who did not meet both criteria in the FILTER function was excluded from the ranking array, resulting in the non-applicable value.
Additional Resources for Data Analysis
Mastering conditional functions is crucial for advanced data manipulation. To deepen your understanding of the components used in the RANK IF methodology, we recommend reviewing the official documentation. The comprehensive resources available provide detailed explanations of function parameters and error handling.
The following tutorials explain how to perform other common tasks in Google Sheets:
Cite this article
Mohammed looti (2025). Learn How to Rank with Criteria in Google Sheets: A Step-by-Step Guide. PSYCHOLOGICAL STATISTICS. Retrieved from https://statistics.arabpsychology.com/use-a-rank-if-formula-in-google-sheets/
Mohammed looti. "Learn How to Rank with Criteria in Google Sheets: A Step-by-Step Guide." PSYCHOLOGICAL STATISTICS, 31 Oct. 2025, https://statistics.arabpsychology.com/use-a-rank-if-formula-in-google-sheets/.
Mohammed looti. "Learn How to Rank with Criteria in Google Sheets: A Step-by-Step Guide." PSYCHOLOGICAL STATISTICS, 2025. https://statistics.arabpsychology.com/use-a-rank-if-formula-in-google-sheets/.
Mohammed looti (2025) 'Learn How to Rank with Criteria in Google Sheets: A Step-by-Step Guide', PSYCHOLOGICAL STATISTICS. Available at: https://statistics.arabpsychology.com/use-a-rank-if-formula-in-google-sheets/.
[1] Mohammed looti, "Learn How to Rank with Criteria in Google Sheets: A Step-by-Step Guide," PSYCHOLOGICAL STATISTICS, vol. X, no. Y, ص Z-Z, October, 2025.
Mohammed looti. Learn How to Rank with Criteria in Google Sheets: A Step-by-Step Guide. PSYCHOLOGICAL STATISTICS. 2025;vol(issue):pages.