Please help.

I'm trying to work this out and can't figure it out. I would like a formula that i can drag down the "Current Holdings and Gain/loss" Columns that will give the following results....

Date Name Type Quantity Price Current Holdings Gain/Loss
1/1/2001 Stock a Initial 1000 1 1000 0
1/2/2001 Stock a Sell 100 2 900 100
1/3/2001 Stock a Buy 100 2.5 1000
1/4/2001 Stock a Sell 200 2 800 50loss+ 100Gain
1/5/2001 Stock a Sell 800 2 600 800
1/1/2001 Stock b Initial 1000 1000
1/2/2001 Stock b Buy 200 1200
1/3/2001 Stock b Sell 150 1050
1/4/2001 Stock b Buy 150 1200



Thanks!