Coming from this answer, I can infer that this is the same as removing the old one, and then adding the new item. However, math isn't my strong side, so maybe there's more optimal approach.
1 Answers
To calculate the new average you need to know the difference in value of the changed item, the old average value and the number of items. Then you can work out the new average as follows:
Suppose one of the items changes from value $a$ to value $a'$, and the sum of the items before the change was $S$ and the sum after the change is $S'$. Then $S-a=S'-a'$ because the sum of the remaining items does not change.
$\Rightarrow S'-S = a'-a$
$S = nA$ where $n$ is the number of items and $A$ is the old average.
$S' = nA'$ where $A'$ is the new average.
$\Rightarrow S'-S=n(A'-A) \\ \Rightarrow a'-a = n(A'-A) \\ \Rightarrow A' = A + \frac{a'-a}{n}$
So the new average is the old average plus the difference in value of the changed item divided by the number of items.

- 15,326