Calculate Percentage Position Within a Range (Google Sheets)

Calculating the percentage position of a value within a range is easy to do in Google Sheets.

You can use this method to quickly assess how close test results (such as medical or instrument measurements) are to the boundaries, evaluate a student’s performance against target ranges, measure salary range penetration, analyze sales with respect to target ranges, and more.

Furthermore, you can use these outputs to create a SPARKLINE bar chart that displays a target range (green) and a certain percentage below and above the target range (red), marking the actual position within this range.

In this tutorial, we will focus on how to calculate the percentage position of a value within a range. We will explore the bar chart option in the next or upcoming tutorials.

Generic Formula to Calculate the Percentage Position within a Range in Google Sheets:

=TO_PERCENT((Actual_Value - Range_Start) / (Range_End - Range_Start))

Example: Formula to Calculate Percentage Position Within a Range

The sample data represents the test name in column 1, the test result in column 2, and the required range in columns 3 and 4. The fifth column shows the percentage position of the actual value within the range.

ParameterActual ValueMin ValueMax Value% of Range Achieved
T31.150.581.6254.81%
T49.61514.548.53%
TSH70.355.1140.00%

If the range is A1:D and A1:D1 contains field labels, you can use the following formula in cell E2 and drag it down as far as you want:

=TO_PERCENT((B2 - C2) / (D2 - C2))
Formula to Calculate Percentage Position Within a Range

Where:

  • (B2 - C2) / (D2 - C2) returns the range penetration value, i.e., (1.15 - 0.58) / (1.62 - 0.58), which is equal to 0.5481.

The TO_PERCENT function converts this number to a percentage.

Array Formula to Calculate the Range Penetration

If you have several test parameters in rows, you might want the results to spill automatically down from the first row.

In the above examples, instead of dragging the formula in cell E2 down, you can convert it into an array formula that spills down as follows:

=ArrayFormula(TO_PERCENT((B2:B4 - C2:C4) / (D2:D4 - C2:C4)))

If you extend the range to cover all rows, i.e., B2:B, C2:C, and D2:D, the formula will return errors in empty rows. To handle this, include an IFERROR function to remove these errors:

=ArrayFormula(TO_PERCENT(IFERROR((B2:B - C2:C) / (D2:D - C2:C))))

Note: The IFERROR function must be inside the TO_PERCENT function; otherwise, it may interfere with the formatting applied by TO_PERCENT.

Use this array formula to calculate percentage positions within ranges in Google Sheets automatically across multiple rows.

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.

Sort Data but Keep Blank Rows in Excel and Google Sheets

Using a dynamic array formula or the FILTER command, we can sort data and...

Lookup Values Under Categories in Excel and Google Sheets

We can use a combination of XLOOKUP and VLOOKUP in both Excel and Google...

Extract Items Under a Category from the Same Column in Excel

In Excel, you can use a combination of the XLOOKUP and DROP functions to...

How to Create a Searchable Table in Excel Using the FILTER Function

Finding specific records, or rows containing the required information, is straightforward in Excel using...

More like this

XMATCH Row by Row: Finding Values Across a Range in Google Sheets

Using the BYROW function with XMATCH in Google Sheets allows us to match values...

Limit Formula Expansion to a Specific Row in Google Sheets

In this tutorial, I’ll explain how to limit the expansion of an array formula...

3-D Referencing Structured Data Tables in Google Sheets

When you have several tables within a single sheet—not across multiple sheets in a...

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.