I have a series of transactions across various customer folios, in different mutual fund products, which are characterized by the fields [Folio_No] and [Prod_Code]. In the appended files, I have restricted the data to one Folio_No and Prod_Code, for simplicity.
Transactions can either be buys ([T_Type]="P") or sells ([T_Type]="R").
I have arrived at the set of transactions in Table-1 (both excel and Access DBase files attached), after adjusting redemptions against purchases in a FiFO method.
So, the sum total of purchase units in Table-1 equals the sum total of redeemed units.
The next step is to match redemptions to purchases as shown in the attached excel, to calculate the gains. We need to do this in a unit-matching manner as shown rather than just do an overall gains, as the nature of the gains depends on the difference between the redemption and purchase dates, and the tax treatment differs by the nature of the gain.
While I could arrive at Table-1 by just setting off the total redemptions in a folio/product against purchases going from earliest to latest, I am at a loss on how to proceed here.
In this case each redemption or purchase has to be examined, and either split into two or more parts, to ensure unit matching.
Any help in getting the right direction on this would be appreciated.
I am appending Table-1 in an access database also, for easy reference, and experimentation with queries/code.
View attachment Tax_Capital_Gains_Illustration_New.xlsx
View attachment CG_Sample.accdb
Sanjay
Transactions can either be buys ([T_Type]="P") or sells ([T_Type]="R").
I have arrived at the set of transactions in Table-1 (both excel and Access DBase files attached), after adjusting redemptions against purchases in a FiFO method.
So, the sum total of purchase units in Table-1 equals the sum total of redeemed units.
The next step is to match redemptions to purchases as shown in the attached excel, to calculate the gains. We need to do this in a unit-matching manner as shown rather than just do an overall gains, as the nature of the gains depends on the difference between the redemption and purchase dates, and the tax treatment differs by the nature of the gain.
While I could arrive at Table-1 by just setting off the total redemptions in a folio/product against purchases going from earliest to latest, I am at a loss on how to proceed here.
In this case each redemption or purchase has to be examined, and either split into two or more parts, to ensure unit matching.
Any help in getting the right direction on this would be appreciated.
I am appending Table-1 in an access database also, for easy reference, and experimentation with queries/code.
View attachment Tax_Capital_Gains_Illustration_New.xlsx
View attachment CG_Sample.accdb
Sanjay