1
$\begingroup$

Say I have a range: 50 through 90, therefore the mean value is 70.

I would like a formula to return the percentage from a given value within that range, based on how close it is to this (middle) value.

So:
50 would return 0%
60 would return 50%
70 would return 100%
80 would return 50%
90 would return 0%

I'm trying to find a formula that could take these parameters to return such a percentage.

Thank you in advance for any help provided :)

$\endgroup$

1 Answer 1

1
$\begingroup$

No one has been able to help with this one so far. I have a solution, but it requires two steps, plus an if condition for the second step.. preferably this would use a single formula which I am sure is possible but I can't seem to work it out. My 2 step solution is as follows:

Step 1: ((input - min) / ((max - min) / 2)) * 100
If output of step 1 is above 100 then apply the following:
Step 2: Abs(200 - output)

Using this process with a couple of examples: ((60 - 50) / ((90 - 50) / 2)) * 100 == 50%
((70 - 50) / ((90 - 50) / 2)) * 100 == 100%
((80 - 50) / ((90 - 50) / 2)) * 100 == 150 (Step 2): Abs(200 - 150) == 50%

So this is producing the results I need but the second step is required. If this isn't possible with one step then I will have to accept this as the answer I guess.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .