Buy 100 shares at ₹500, another 100 at ₹400, and your average price is ₹450. Sell 50 of them, though, and the number your broker shows can jump to ₹433.33, because Indian brokers and the Income Tax Department treat the oldest shares as sold first. To calculate the average stock price, add up what you paid for every share you still hold and divide by the number of shares. The harder part is knowing which shares count as “still held” after a sale, a bonus or a split. This guide covers Indian equities held in demat form, with figures in rupees.
Average Cost, FIFO Sales and the Averaging-Down Formula
- Average price = total cost of shares held ÷ number of shares held.
- For demat shares, the Income Tax Department applies first in, first out (FIFO), so the earliest purchases are treated as sold first.
- A FIFO sale can turn what looks like a profit on your average into a capital loss on paper, and the reverse.
- To reach a target average when averaging down, buy Q × (A − T) ÷ (T − P) more shares, where Q is current quantity, A your average, T the target and P today’s price.
- Bonus shares come in at zero cost and splits multiply the share count, so both cut the average without changing total cost.
The Average Stock Price Formula
The calculation is a weighted average. Multiply each purchase quantity by its price, add the results, then divide by the total number of shares.
Average price = (Q1 × P1 + Q2 × P2 + … ) ÷ (Q1 + Q2 + …)
A simple average of the prices themselves gives the wrong answer whenever you bought different quantities. Buying 10 shares at ₹100 and 90 shares at ₹200 does not give an average of ₹150. The correct figure is (1,000 + 18,000) ÷ 100, or ₹190.
Worked Example: Two Buys, No Sales
An investor buys 100 shares at ₹500 in January and, after a fall, another 100 at ₹400 in March. We ran the figures in Python.
| Lot | Quantity | Price | Cost |
|---|---|---|---|
| January | 100 | ₹500 | ₹50,000 |
| March | 100 | ₹400 | ₹40,000 |
| Total | 200 | ₹450 average | ₹90,000 |
With the stock at ₹400, the holding is down 11.1% on its ₹450 average. It needs a 12.5% rise from ₹400 to break even, compared with 25% had the investor not bought the second lot. That is the appeal of averaging down, and also its trap, as the next sections show.
Why Selling Changes Your Average: FIFO
Most investors assume that after a partial sale, the remaining shares keep the old average. In India they usually do not. The Income Tax Department’s Circular No. 768 of 24 June 1998 says that for shares held in a demat account, the FIFO method applies in working out the date of transfer and the period of holding. The shares that entered the account first are treated as the ones sold first, and the cost comes from the contract notes for those earliest lots.
Brokers follow the same rule. Zerodha’s support page says its buy average follows FIFO and that the Income Tax Department requires FIFO for reporting profit and loss. Two details in the circular are easy to miss:
- FIFO works account by account: where an investor has more than one demat account, a sale from one does not affect the shares sitting in another.
- Old physical shares count from the demat date: for certificates dematerialised later, the FIFO queue uses the date they were credited to the demat account, though the original cost and purchase date still apply for tax.
The Same Sale, Two Different Answers
Back to our investor. In May the stock is at ₹460 and they sell 50 shares.
| Method | Cost of 50 shares sold | Result on sale at ₹460 | Average of remaining 150 |
|---|---|---|---|
| Simple average (how many investors think) | ₹450 each | ₹500 profit | ₹450 |
| FIFO (tax and broker records) | ₹500 each, from the January lot | ₹2,000 loss | ₹433.33 |
Under FIFO the 50 shares sold come out of the January lot bought at ₹500, so the sale books a ₹2,000 capital loss. What remains is 50 shares at ₹500 and 100 at ₹400, a total cost of ₹65,000 across 150 shares, or ₹433.33 each. The investor’s position has not changed in any economic sense, but the tax record and the holdings screen both shift.
Zerodha’s own worked example shows the same mechanics: a 20-share sale is taken from the earliest lot at ₹260, and the remaining 80 shares end up with a buy average of ₹261. Intraday trades sit outside this. If you sell and buy back the same day, the page says the difference is booked as intraday profit or loss and the holdings average is left alone.
How Many Shares to Buy to Reach a Target Average
Rearranging the weighted-average formula gives the number of extra shares needed to pull an average down to a target:
Shares to buy = Q × (A − T) ÷ (T − P)
Q is the quantity held, A the current average, T the target average and P the current market price. The target must sit between the market price and your current average, otherwise no quantity will get you there.
| Holding 100 at ₹500, price ₹400 | Extra shares needed | Extra money at ₹400 |
|---|---|---|
| Target average ₹480 | 25 | ₹10,000 |
| Target average ₹450 | 100 | ₹40,000 |
| Target average ₹420 | 400 | ₹1,60,000 |
The cost rises steeply as the target nears the market price. Pulling the average from ₹450 to ₹420 needs four times the shares that took it from ₹500 to ₹450. At that point the position is mostly the new purchase, and the decision is really whether you would buy ₹1.6 lakh of this stock today on its own merits. Averaging down is arithmetic. It says nothing about whether the business is worth more than its current price.
How Bonus Issues and Stock Splits Change the Average
Corporate actions change the share count, not what you paid. Zerodha explains that it records bonus shares at zero cost, so the same total cost is spread over more shares and the average falls. Its example: three shares costing ₹8,890 in total, then a 3:1 bonus adds nine shares, and the average drops from ₹2,963.33 to about ₹740.83.
Splits work through the share count too. Total cost stays the same and the quantity multiplies, so the average divides by the split factor. Applied to our investor’s remaining 150 shares with ₹65,000 of cost:
| Event | Shares after | Total cost | New average |
|---|---|---|---|
| Before any action | 150 | ₹65,000 | ₹433.33 |
| 1:1 bonus (one free share per share held) | 300 | ₹65,000 | ₹216.67 |
| Split into five shares each | 750 | ₹65,000 | ₹86.67 |
Bonus shares carry a quirk under FIFO. Zerodha’s example shows that once the older paid-for lots are sold, the remaining bonus shares can be left with an average of zero. Eligibility for these actions depends on holding the shares by the ex-date, which our explainer on record date vs ex-date walks through.
Checking Your Broker’s Number
- Use the tradebook, not memory: download every buy and sell for the stock from your broker’s back-office and line them up by date.
- Remove sold lots from the top: strike off quantities from the oldest purchase first until the sold quantity is used up.
- Adjust for corporate actions: add bonus shares at zero cost and multiply quantities by any split factor from the ex-date.
- Flag transfers in: for shares moved from another demat account or received off-market, check that the original purchase price and date are recorded, and update them with the broker if not.
For IPO shares, your cost is the issue price you paid. Our piece on the IPO special pre-open session explains how the listing-day price is set, which is a different number from your cost. For the related idea of the price at which a position stops losing money, see our break-even calculator, and browse more explainers in Stocks.
This article is for information and education only and is not investment, tax or financial advice. Figures were checked on 29 October 2026; confirm current details with the official source or a registered adviser before acting.
Why Bonus Issues and Sales Change Your Buy Average
How Do You Calculate Average Share Price?
Multiply each purchase quantity by its price, add the totals, and divide by the total number of shares held. A plain average of prices is wrong when quantities differ.
Does Selling Shares Change the Average Price?
Under FIFO, yes. The oldest shares are treated as sold first, so the average of what remains moves toward the price of your later purchases.
Is FIFO Mandatory for Shares in India?
For shares held in demat form, the Income Tax Department’s Circular 768 of 1998 applies FIFO to decide which shares were sold. It works separately for each demat account.
Why Did My Average Price Drop After a Bonus Issue?
Bonus shares are recorded at zero cost. The same total cost is now spread over more shares, so the per-share average falls even though your investment is unchanged.
How Many Shares Should I Buy to Average Down?
The formula Q × (A − T) ÷ (T − P) gives the quantity needed for a target average. Whether to buy at all depends on the company, not the arithmetic.





