Example:
I'm trying to figure out the calculation for finding the percentage between two values that a third value is.
Example: The range is 46 to 195. The value 46 would 0%, and the value 195 would be 100% of the range. What percentage of this range is the value 65?
rangeMin=46
rangeMax=195
inputValue=65
inputPercentage = ?
Answer: To find the percentage of a number between two numbers, divide one number with the other and then multiply the result by 100. Let us see an example of finding the percentage of a number between two numbers. Explanation: Let us find the percentage of 30 in 45.
Percent difference formula is obtained by dividing the absolute value of change by the average of the values and then multiplying it with 100.
Percentage difference is useful in manufacturing, design or engineering. Calculating the percentage difference between three numbers requires calculating the percentage differences between paired numbers of the three. Finding this result requires no mathematical knowledge beyond basic arithmetic.
Enter the formula =C2/B2 in cell D2, and copy it down to as many rows as you need. Click the Percent Style button (Home tab > Number group) to display the resulting decimal fractions as percentages. Remember to increase the number of decimal places if needed, as explained in Percentage tips. Done! : )
Well, I would use the formula
((input - min) * 100) / (max - min)
For your example it would be
((65 - 46) * 100) / (195 - 46) = 12.75
Or a little bit longer
range = max - min correctedStartValue = input - min percentage = (correctedStartValue * 100) / range
If you already have the percentage and you're looking for the "input value" in a given range, then you can use the adjusted formula provided by Dustin in the comments:
value = (percentage * (max - min) / 100) + min
I put together this function to calculate it. It also gives the ability to set a mid way 100% point that then goes back down.
Usage
//[] = optional rangePercentage(input, minimum_range, maximum_normal_range, [maximum_upper_range]); rangePercentage(250, 0, 500); //returns 50 (as in 50%) rangePercentage(100, 0, 200, 400); //returns 50 rangePercentage(200, 0, 200, 400); //returns 100 rangePercentage(300, 0, 200, 400); //returns 50
The function
function rangePercentage (input, range_min, range_max, range_2ndMax){ var percentage = ((input - range_min) * 100) / (range_max - range_min); if (percentage > 100) { if (typeof range_2ndMax !== 'undefined'){ percentage = ((range_2ndMax - input) * 100) / (range_2ndMax - range_max); if (percentage < 0) { percentage = 0; } } else { percentage = 100; } } else if (percentage < 0){ percentage = 0; } return percentage; }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With