I don't really understand your request.
The cell you are pointing to in your screen shot should already be calculated before, right ("I have the sorting and sum all worked out in Projectie2 (with a rangesum).")?
What does your current script deliver compared to that screenshot?
Maybe I am just a bit confused about what you are showing being the expected or the actual output?
Maybe just show both, best in combination with a small working sample QVW.