John Doe's comment was just what I needed, but since it's just a comment I can't choose it as the answer. Anyway, I wrote a brief function that gives more consistent results than my old code. It's also much simpler and shorter. numberOf is the number of songs with a rating, Rating is the rating, and bonus_penalty is how much I'm adding/subtracting based on distance from neutral_rating. I simply do this for each rating, add the results for each function call, and then divide by the number of songs.
I believe this is more-or-less what John Doe was proposing, and it appears to work as it should. Thanks!
Function ScoreForRating(numberOf As Integer, Rating As Integer, bonus_penalty As Double, neutral_rating As Integer)
Dim adjustment As Double
adjustment = 1 + numberOf * ((Rating - neutral_rating) * bonus_penalty)
ScoreForRating = (Rating * numberOf) * adjustment
End Function
Neither of your two examples matches your description: instead of $(85,5,10)$, I would have expected $(81,9,10)$, because that preserves the ratio $a:b$, i.e., $90:10=81:9$. Maybe there was a miscalculation?
If that's the case, then here's the idea: suppose you have some percentages $(a,b,c,d)$ and you're changing $d$ to $d+\Delta$. Then we need to remove a total of $\Delta$ from the other three while preserving the ratio $a:b:c$.
Looking at $a$ as a fraction of $a+b+c$, we have $\frac a{a+b+c}$. This is the fraction of $\Delta$ by which $a$ must decrease, so the new value of $a$ will be
$$a - \left(\frac a{a+b+c}\right)\Delta,$$
which after factoring out the $a$ we can rewrite as
$$a\left(1 - \frac \Delta{a+b+c}\right).$$
To put it more simply, let $T$ be the total of the first three values: $T=a+b+c$. Then the new value of $a$ will be $a\left(\frac{T-\Delta}T\right).$
The changes to $b$ and $c$ are similar; therefore, the new values of $(a,b,c,d)$ will be
$$\left(a\left(\frac{T-\Delta}T\right), b\left(\frac{T-\Delta}T\right), c\left(\frac{T-\Delta}T\right), d + \Delta\right).$$
Finally, note that the case $a=b=c=0$ will have to be given special treatment.
Best Answer
Once you have an average rating, one way that makes sense is to show the percentage of the way up the range. You would calculate that by (average rating-minimum rating)/(max rating - min rating). If the average is $2.23$ on a scale of $1$ to $5$, it would be $\frac {2.23-1}{5-1}=0.3075=30.75\%$. Many people would just do average rating/max rating, but in our example that would give $20\%$ to a $1$ rating, the worst possible. If you look at your calculation this will happen.