Forum Discussion
Recursive running totals
Hi and thanks for this; the case is a bit complicated, but I make an attempt.
I am collecting fund transactions from various sites and trying to consolidate these. For some sites the challenge is to translate funds with foreign currency into my domestic one.
The key issue appears when shares are sold and to calculate the change to the domestic total acquisition cost for a specific fund.
In the example below the sales amount (Amt YYY) and the result (Res YYY) is correct in the foregin currency. Just calculating the acquisition value impact using the the exchange rate for the sales date will give a skewed figure as the domestic acquisition value is agregated over time with different exchange rates (see pink cells)
What I have tried to do is to calculate the domestic acquisition value per share for each date (AV/Share ZZZ) and then use that to calculate the domestic acquisition value (AV ZZZ) by using the AV/Share and transaction quantity and then then calculating the total acquisition value (Tot AV ZZZ).
Link to data attached Calculating domestic AV
As mentioned a bit complicated, but hopefully possible to grasp.