I am trying to work out the profit on each stock whether sold entirely or partially but I cannot seem to get the number right. In the attached file, the Profit/Loss column is the one I am keen to this right. The result should be as under:
5-Mar-25 Sale:
- Sell 8 shares at $160.
- The first 8 shares come from the 10 shares bought on 01-Feb-25 at $150.
- Cost of 8 shares = 8 × $150 = $1200.
- Sale proceeds = 8 × $160 = $1280.
- Profit = $1280 - $1200 = $80.
15-Apr-25 Sale:
- Sell 6 shares at $162.
- First 2 shares come from the remaining 2 shares at $150.
- Next 4 shares come from the 5 shares bought at $155.
- Cost of 6 shares = (2 × $150) + (4 × $155) = $300 + $620 = $920.
- Sale proceeds = 6 × $162 = $972.
- Profit = $972 - $920 = $52.