Calculation based on previous transactions

punnu07

New Member
Joined
Apr 19, 2015
Messages
34
Hi,

I have a problem to solve.

I have a data set of 7000 transactions and I need to calculate the amount for each transaction as per below formula. Please note that calculation will be done basis of account number.

Account NumberValuePercentageAmount
ABC10000.1=(B2)*C2-0
ABC10000.15=(B3+B2)*C3-(D2)
ABC10000.05=(B4+B3+B2)*C4-(D3+D2)
DEF10000.1=(B5)*C5-0
DEF10000.15=(B6+B5)*C6-(D5)
DEF10000.05=(B7+B6+B5)*C7-(D6+D5)
DEF10000.1=(B8+B7+B6+B5)*C8-(D7+D6+D5)
QWE10000.15=(B9)*C9-0
QWE10000.05=(B10+B9)*C10-(D9)
QWE10000.1=(B11+B10+B9)*C11-(D10+D9)
QWE10000.15=(B12+B11+B10+B9)*C12-(D11+D10+D9)
QWE10000.05=(B13+B12+B11+B10+B9)*C13-(D12+D11+D10+D9)
QWE10000.1=(B14+B13+B12+B11+B10+B9)*C14-(D13+D12+D11+D10+D9)

<tbody>
</tbody>

((Value of current transaction + value of all previous transactions) x NEW percentage%) - (sum of all previous values)

Can anyone please help me with a generic excel formula which can be put in all 7000 transactions or any VBA code.

Thank you in advance.
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
put B2*C2 in D2, and

=C3*SUMIF($A$2:A3,A3,$B$2:B3)-SUMIF($A$2:A2,A3,$D$2:D2) in D3, copy down
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,827
Messages
6,121,812
Members
449,048
Latest member
greyangel23

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top