Does average price change if I buy low and sell partial holdings on high price?

Hi Guys,

I know it may sound like a dumb question. But, I just want to know if the average buy price of a stock holdings will change in the following scenario.

1. Bought 100 stocks in 2019 @ 250rs / stock
2. Bought 200 stocks in 2020 @ 320rs / stock
3. Bought 150 stocks in 2021 @ 350rs / stock

Let’s say the average price of total 450 stocks was 305rs/stock till yesterday.

Sold 175 out of the total positions today @ 450rs / stock.

The above is an example scenario and just for reference. After the sell execution today, the average price of left over quantity will change or it will stay the same?


First of all, the average buy price will remain same at 314.44 / stock (using till yesterday is wrong).

When you sell 175 @ 450, the stocks are debited in a first in first out order, so 100 goes from 2019 batch and 75 from 2020 batch.

Remaining stock: 125 @ 320 in 2020
150 @ 350 in 2021

Average buy price for the remainder: 336.36

Total realised profit: 29750

Hope you understood.

Thanks for the reply. I was trying to understand the concept of FIFO but I am not able to understand that why one have to sell the stocks from 2019 and 20 only. I mean, if the purchase of 2019 stocks is at low price, I will not prefer to sell them first, I will prefer 2020 stocks as they will put less effect on the overall average price.
I am sorry if I am making it difficult, but this whole method looks somewhat complicated :roll_eyes:

This is because shares that are held in dematerialized form are indistinguishable from one another. You can only instruct your broker to sell some number of shares of a particular company from your account. There is no way to instruct the broker to sell specific shares—say, the shares that you bought in 2021—and not others—say, the shares that you bought in 2019.

Given this lack of granularity, the IT department has decided that share sales are to be accounted in the FIFO manner from each demat account. I imagine this is to enforce uniformity, and to keep the computations—and their verification—simple.

Note that if you do have enough granularity to distinguish between shares, then you can sell shares in non-FIFO order:

  • If you bought your 2019, 2020, and 2021 shares into three different demat accounts, then you can choose to sell from any of these three accounts as you wish. FIFO applies per demat account, not per company that you hold.
  • Till some time ago we could sell shares which were held in certificate form. In that case, you could sell whichever share that you wished to sell: it didn’t have to be in FIFO order of purchase.
1 Like