Does selling part of a position change your average price?
Short answer: no, under the average cost method most brokers use. A sale removes shares at your current average; the difference between the sale price and that average is realized profit or loss. Your average only changes when you buy.
Worked example
You bought 80 shares at 78 and 40 at 71: average (6,240 + 2,840) ÷ 120 = 75.67. You sell 20 at 74.50. Realized = (74.50 − 75.67) × 20 = −23.33. You now hold 100 shares, still at 75.67.
Buying again after a sale
New buys combine with the remaining shares at the unchanged average: 50 more at 68.90 gives (75.67 × 100 + 68.90 × 50) ÷ 150 = 73.41.
Selling everything
When the quantity reaches zero, the average resets. The next buy starts a fresh average.
Fees
Buy fees raise your cost basis; sell fees reduce the realized profit.
Doing it with AvgNote
Log buys and sells per stock in the ledger. AvgNote keeps the average through partial sells, shows realized profit separately, and warns you if a sale is larger than what you held on that date.