What have you tried so far?
It is very hard to code from pictures and cryptic arrows with random values really do not describe an algorithm. Is the arrow a sum? division? accumulation? what.
This is such a small number of records you should be able to write out the exact calculation you need, at least in terms of + * / or - symbols. That we may be able to show how to code.
Do you have a SAS data set to work with?