Dividends reinvested in prior years have been taxed in the year of the dividend.
Assume an investment of 100 shares costing $1,000 in year 1. This is not a taxable event.
At the end of year 1, a $100 dividend buys five shares of stock at $20/share. The $100 in dividend income is taxed on your Federal 1040 tax return.
At the end of year 2, a $100 dividend buys four shares of stock at $25/share. The $100 in dividend income is taxed on your Federal 1040 tax return.
On the first day of business in year 3, all 109 shares are sold. The cost of the 109 shares is $1,200 which includes the two $100 dividends reinvested and taxed.
The average cost per share is $1,200 investment / 109 shares equals $11.00/share.
**Say "Thanks" by clicking the thumb icon in a post**Mark the post that answers your question by clicking on "Mark as Best Answer"