I am interested in finding the value associated with particular percentages (e.g $80\%$, $60\%$, etc.) along a range of values.
For example, one of the sets of values of interest goes from $2$ to $8$ (and so the value associated with $50\%$ will be $5$ since this is the midpoint between $2$ and $8$). Another example would be the set of values ranging from $3$ to $15$ (the value associated with $50\%$ of that range's value would be 9 here).
How do I come up with some formula to find $\%$ and values at $80\%$, $60\%$, $40\%$, $20\%$ and make it dynamic (so that I can plug in any range and it would give me values at those $\%$).
Thank you.
We can reduce this to a simple formula for a given range and percentage using the result that for any interval from $a$ to $b$ and a percentage $P%$, we can find the corresponding desired values by computing $a+ \frac{P}{100}(b-a)$.
More intuitively, this can be phrased as starting at the point $a$ and finding the point that is $P$% of the way along the total length of the line. And the total length of the line is simply $b-a$ (the range), hence the formula presented above.