Here are the facts: Donor owns 100 shares of ABC stock, which is publicly traded. Each share is worth $200 and has a $50 cost basis.
What Donor wants to do: Donor wants to donate some of the shares and sell the remaining shares. She wants the charitable deduction for the donation to offset exactly the capital gain on the sale. So that she walks away owing net zero capital gain tax.
Here’s the question: How many shares should she donate? How many shares should she sell?
We need some more information: We need to know the marginal income tax rate against which the charitable deduction will apply. Let’s assume it’s 40 percent (0.4). We also need to know the applicable capital gain tax rate. Let’s assume it’s 20 percent (0.2).
Here we go: It’s all a matter of logic.
1. Donor is going to give n shares. She is, therefore, going to sell (100 – n) shares. We want to find n.
2. The tax savings produced by the gift will be 0.4n($200), which is $80n.
3. The capital gain tax for each share sold will be 0.2($200 – $50), or 0.2($150), or $30.
The capital gain tax for (100 – n) shares sold will be $30(100 – n), or ($3,000 – $30n).
4. Now, Donor wants the tax savings from her gift to offset (be equal to) the capital gain tax on the shares sold.
This means: $80n = $3,000 – 30n.
5. Solving: $110n = $3,000. n = 3,000/110
You have two tasks:  Find n to the nearest whole share.  Check to see that this value of n achieves Donor’s goal.
Further discussion next time.
by Jon Tidd, Esq