RE:TDameritrade , SchwabHey Farm,
If you use the web to sell the stock instead a live broker. You can just use the average for capital gain. Take the number shares and divide against total cost to buy. That gives you the average buy in cost.
But somewhere in the web site in a cost per share per buy. If I find it I will give you a shout.
Dragon