Google Sheets PERCENTRANK.EXC Function Guide
In this article
The PERCENTRANK.EXC function in Google Sheets calculates the relative standing of a specific value within a dataset, returning a percentage (represented as a decimal between 0 and 1) that indicates the percentage of values in the range that are strictly less than the given value. Unlike its counterpart, PERCENTRANK.INC, the .EXC (exclusive) version excludes the boundaries of the dataset, meaning it will never return exactly 0 or 1 unless the value falls outside the range of the data provided. This is particularly useful for statistical analysis where you need to know where a value sits relative to a group without including the extreme ends of the distribution in the calculation.
What You'll Need
- A Google account with access to Google Sheets.
- A dataset consisting of numerical values (e.g., test scores, sales figures, or temperature readings) arranged in a column or row.
- A specific value (the "x" value) that you want to rank against the rest of the dataset.
Step-by-Step
- Prepare Your Data: Open your Google Sheet and ensure your numerical data is organized in a continuous range. For example, if you have a list of 20 student exam scores, place them in cells A2 through A21. Ensure there are no text strings or empty cells within this range, as these can sometimes lead to unexpected results or errors.
- Identify Your Target Value: Decide which value you want to rank. This value can be one of the numbers already present in your range, or it can be a separate number you are comparing against the group. For this guide, assume your target value is located in cell C2.
- Enter the Function: Click on the cell where you want the percentage rank to appear (e.g., D2). Type
=PERCENTRANK.EXC(to begin the formula. - Define the Data Array: While the cursor is inside the parentheses, highlight the range of cells containing your dataset. In our example, you would click and drag from A2 to A21. Your formula should now look like
=PERCENTRANK.EXC(A2:A21,. - Select the Value to Rank: Type a comma to separate the arguments, then click on the cell containing the value you wish to rank (C2). The formula should now be
=PERCENTRANK.EXC(A2:A21, C2). - Close and Execute: Type the closing parenthesis
)and press Enter. Google Sheets will now calculate the percentage of values in the range A2:A21 that are smaller than the value in C2. - Format as Percentage: By default, the result will be a decimal (e.g., 0.75). To make this more readable, select the cell, go to the top menu bar, and click the % (Format as percent) button. The 0.75 will now appear as 75%.
- Apply to Multiple Values (Optional): If you have a list of multiple values you want to rank against the same dataset, click the small blue square in the bottom-right corner of the result cell (D2) and drag it down. To ensure the data range stays the same while the target value changes, use absolute references for the range. Change the formula to
=PERCENTRANK.EXC($A$2:$A$21, C2)before dragging.
Common Mistakes
One of the most frequent errors is confusing PERCENTRANK.EXC with PERCENTRANK.INC. The "INC" version includes the 0th and 100th percentiles, meaning the lowest value in your set will always be 0% and the highest will always be 100%. The "EXC" version is more restrictive; if you try to rank the absolute minimum or maximum value of your dataset using .EXC, the function will return a #NUM! error. This is because the function is designed to find values strictly between the boundaries.
Another common mistake is including non-numeric data in the array. While Google Sheets often ignores text in range-based functions, having hidden characters or numbers formatted as text can cause the ranking to be inaccurate. Always ensure your data is formatted as "Number" via the Format > Number menu.
Users also frequently forget to use absolute references (the dollar signs) when dragging a formula. If you use A2:A21 instead of $A$2:$A$21, Google Sheets will shift the range down by one cell for every row you drag the formula, leading to incorrect rankings or #N/A errors as the range moves into empty cells.
Tips
To handle the #NUM! error that occurs when ranking the extreme ends of a dataset, you can wrap your formula in an IFERROR function. For example: =IFERROR(PERCENTRANK.EXC(A2:A21, C2), "Out of Range"). This replaces the ugly error code with a custom message of your choice.
If you are working with a very large dataset that changes frequently, consider using a Named Range. Highlight your data, go to Data > Named ranges, and name it "Scores". Your formula then becomes =PERCENTRANK.EXC(Scores, C2). This makes your formulas much easier to read and maintain across different sheets.
For a more comprehensive analysis, pair PERCENTRANK.EXC with conditional formatting. You can set a rule that highlights cells in green if the result is above 0.90 (top 10%) and red if it is below 0.10 (bottom 10%), allowing you to visualize performance gaps instantly.
Troubleshooting
If your formula is not working as expected, first check for the #NUM! error. As mentioned, this happens if the value you are ranking is equal to or exceeds the maximum value in the range, or is equal to or less than the minimum value. If this is happening, verify if you should be using PERCENTRANK.INC instead, which allows for the inclusion of the 0 and 1 boundaries.
If you see a #N/A error, it usually means the range you specified is empty or the target value is not a number. Double-check that your range (e.g., A2:A21) actually contains numbers and that the cell you are ranking (C2) is not blank.
If the result seems mathematically incorrect, check for duplicate values in your dataset. PERCENTRANK.EXC handles duplicates by treating them as the same rank. If a large portion of your data consists of the same number, the jumps between percentage ranks will be larger and may seem unintuitive at first glance.
If the formula simply returns a decimal like 0.45 and you expected a percentage, remember that Google Sheets treats percentages as decimals. You must manually change the cell format to "Percentage" using the toolbar to see the value as 45%.
Frequently Asked Questions
What is the difference between PERCENTRANK.EXC and PERCENTRANK.INC?
PERCENTRANK.EXC (exclusive) excludes the 0 and 1 boundaries, meaning it cannot return exactly 0% or 100% and will error out if the value is the absolute min or max. PERCENTRANK.INC (inclusive) includes those boundaries, ensuring the lowest value is 0% and the highest is 100%.
Can I use a cell reference for the data range?
Yes, you can use a range of cells (like A1:A10). You cannot, however, use a single cell as the array; the first argument must be a group of cells containing multiple values to create a distribution for ranking.
Does the order of the data in the range matter?
No, the data does not need to be sorted in ascending or descending order. The function automatically analyzes the entire range to determine the relative position of the target value regardless of how the cells are organized.
Why does my formula return #NUM! when I rank the highest value?
This is the intended behavior of the .EXC version of the function. Because it is "exclusive," it calculates the rank based on values strictly less than the target. If the target is the maximum, it cannot satisfy the exclusive boundary logic for the 100th percentile.
Can I rank a value that isn't in the dataset?
Yes. You can enter any number as the second argument. The function will tell you where that hypothetical number would fall if it were added to the existing dataset.