D
Dallman Ross
Hi, folks,
Given a sheet of data about stock sales, I want to combine the lots
that were sold on the same day for the same price for the same
stock symbols.
For example, say I have:
A B C D E F G H I
1 Symbol Shares Date Bot PPrice Cost Date Sold SPrice Proceeds G/L
2 TSRA 100 3/1/2007 38.56 3,856.00 3/21/2007 41.05 4,104.93 248.93
3 TSRA 100 3/5/2007 37.66 3,766.00 3/21/2007 41.64 4,163.93 397.93
4 TSRA 30 3/2/2007 38.56 1,156.80 3/21/2007 41.05 1,231.48 74.68
5 TSRA 30 3/5/2007 37.66 1,129.80 4/5/2007 42.03 1,260.88 131.08
6 XRX 10 3/2/2007 16.86 168.60 4/18/2007 18.12 181.20 12.60
7 XRX 290 3/2/2007 16.86 4,889.40 4/20/2007 18.68 5,417.02 527.62
8 XRX 290 2/27/2007 17.36 5,034.40 4/18/2007 18.12 5,254.71 220.31
I will be writing lines to a new worksheet and combining the lots.
So lines 2 and 4 as well as lines 6 and 8 will have their data
combined.
Column B on the new sheet for that sale will say, for lines 2 & 4,
130 shares. For lines 6 & 8, 300 shares. I'll average the date
bought, weighted based on the dollar amount of the sale. Ditto
purchase price. Cost ought to still be the sum of the combined
cost lines. Date Sold doesn't change -- it's one of the bases for
combining data. Ditto Sale Price. Proceeds will be a simple
sum, as will gain/loss. Any ideas would be much appreciated.
Given a sheet of data about stock sales, I want to combine the lots
that were sold on the same day for the same price for the same
stock symbols.
For example, say I have:
A B C D E F G H I
1 Symbol Shares Date Bot PPrice Cost Date Sold SPrice Proceeds G/L
2 TSRA 100 3/1/2007 38.56 3,856.00 3/21/2007 41.05 4,104.93 248.93
3 TSRA 100 3/5/2007 37.66 3,766.00 3/21/2007 41.64 4,163.93 397.93
4 TSRA 30 3/2/2007 38.56 1,156.80 3/21/2007 41.05 1,231.48 74.68
5 TSRA 30 3/5/2007 37.66 1,129.80 4/5/2007 42.03 1,260.88 131.08
6 XRX 10 3/2/2007 16.86 168.60 4/18/2007 18.12 181.20 12.60
7 XRX 290 3/2/2007 16.86 4,889.40 4/20/2007 18.68 5,417.02 527.62
8 XRX 290 2/27/2007 17.36 5,034.40 4/18/2007 18.12 5,254.71 220.31
I will be writing lines to a new worksheet and combining the lots.
So lines 2 and 4 as well as lines 6 and 8 will have their data
combined.
Column B on the new sheet for that sale will say, for lines 2 & 4,
130 shares. For lines 6 & 8, 300 shares. I'll average the date
bought, weighted based on the dollar amount of the sale. Ditto
purchase price. Cost ought to still be the sum of the combined
cost lines. Date Sold doesn't change -- it's one of the bases for
combining data. Ditto Sale Price. Proceeds will be a simple
sum, as will gain/loss. Any ideas would be much appreciated.