Maybe running through this with numbers will make it clearer to the OP. Assuming these are the only shares owned and transacted.
Day 1: Buy 100 shares @$10 Day 60: Buy 100 shares @$5 Day 61: Sell 200 shares @5
You have a sale transaction on Day 61. Gross proceeds from the sale = 200 * $5 = $1000 Basis in shares sold = 100 * $10 + 100 * $5 = $1500 Net gain/loss = proceeds - basis = $1000 - $1500 = -$500 (a loss)
Now we can make this slightly more complicated by doing the following (with FIFO):
Day 1: Buy 100 shares @$10 [lot 1] basis $1000 Day 60: Buy 100 shares @$5 [lot 2] basis $500 Day 61: Sell 100 shares @5 Day 62: Sell 100 shares @5
Here you have two sales transactions: Day 61: Sell lot 1, proceeds = $500, basis (FIFO) = $1000 But this is a wash sale, so the $500 loss is disallowed. However, the disallowed loss increases the basis of remaining shares, so the basis for lot 2 increases from $500 to $1000 Net gain/loss is $0
Day 62: Sell lot 2, proceeds = $500, basis = $500 original + $500 from disallowed wash sale net gain/loss is $500 proceeds minus $1000 adjusted basis = $500 loss. This is not a wash sale since there are no other shares owned or bought within 30 days. In effect, the $500 loss has been transferred from the first sale to the second by the operation of the wash sale rules.
The first example can be thought of as the combination of the two transactions in the second example. Since that sale is listed on a single line of Schedule D, it doesn't really matter whether you transfer the $500 basis from the first lot to the second since they are both added together and 1000 + 500 = 500 + 1000 (because addition is commutative. Thank you, class)
-- Tom Russ (not Lehrer)