Excel macro help needed

Jaydoubleu

New Member
Joined
Mar 12, 2009
Messages
1
Hi i have a question regarding excel
Below is my worksheet regarding trades:
Name Amount Type Trade Price Position Capital
0
ABI 1000 Sell -1000 19,89 -1000 19890
ABI 1000 Sell -1000 20,18 -2000 20180
ABI 1000 Buy 1000 20,05 -1000 -20045
ABI 500 Buy 500 19,64 -500 -9820
ABI 500 Buy 500 19,73 0 -9862,5
ABI 1500 Sell -1500 19,65 -1500 29475
ABI 500 Buy 500 19,55 -1000 -9772,5
ABI 1000 Buy 1000 19,55 0 -19550
MT 1500 Sell -1500 19,40 -1500 29103,75
MT 1571 Sell -1571 19,41 -3071 30490,49167
MT 1000 Sell -1000 19,36 -4071 19357,5
MT 1000 Buy 1000 19,35 -3071 -19350
MT 1000 Buy 1000 19,36 -2071 -19362
MT 2071 Buy 2071 19,40 0 -40167,045

These are stocktrades, but i would like to calculate the result of my trades. This i want to do by adding up all "capital" fields for every trade which brings my postition back to 0 (Position field). So in this case the first 5 rows are 1 trade, the next 3 and the next 6. I need a macro which looks at the Cum field and if its zero it adds-up all capital fields belonging to that trade, so all capital field starting at that 0 and upwards until the next Position = 0 is reached (excluding that one ofcourse).
Could anyone help me with such a macro? Unfortunatly im not that gifted that i can do this myself.
Regards,
Jay
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.

Forum statistics

Threads
1,214,392
Messages
6,119,254
Members
448,879
Latest member
oksanana

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