I'm looking for a formula that would work to elevate my students' grades. What I'm trying to say is when the minimum score gotten by my student is $0$ and the maximum is $42$, I want to convert them proportionally to the new range I.e. from
$$0\leq x \leq 42$$
to
$$80\leq x \leq 91$$ ?
I expect something like this happens:
$$\begin{align} 0&\rightarrow80\\ 20&\rightarrow81\\ 43&\rightarrow82\\ 54&\rightarrow83\\ 79&\rightarrow85\\ 85&\rightarrow87\\ 92&\rightarrow88\\ 100&\rightarrow91\\ \end{align}$$
Another example if I want to convert numbers from $[70,\,100]$ to $[80,\,91]$:
$$\begin{align} 70&\rightarrow80\\ 79&\rightarrow83\\ 80&\rightarrow84\\ 85&\rightarrow86\\ 90&\rightarrow88\\ 91&\rightarrow88\\ 97&\rightarrow90\\ 100&\rightarrow91\\ \end{align}$$
Mind you, the rows of numbers up there are just the picture, and it would be even more useful if the proportional depends on the original minimum and maximum input, since suppose if the minimum is $90$ and maximum is $100$, it has the different proportional rate to the previous range into the range I want, i.e. $80$ to $91$.
The best formula I could think of is this:
$$f(x) = \begin{cases} 80, & x \le 0, \\[6pt] 80 + \displaystyle\frac{11}{42}\,x, & 0 < x < 42, \\[10pt] 91, & x \ge 42. \end{cases}$$
but that's not fair since I have tested it on Google Spreadsheet that some elements in the domain interval have the same $y$ value mapped to. If it is possible, perhaps not a piecewise function. Is there a better way?
In some way, I'm thinking of a proportion formula just like when I wish to find the length of an unknown triangle with the known information lengths from another triangle that is "similar" to it, but how to apply it as one formula for all cases?