How to Calculate Capital Gains for Multiple Share Purchases?
When the same security is bought multiple times, capital-gain calculation requires the acquisition lots to be matched with the sales using the applicable transaction-matching rules, including FIFO where relevant.
Quick Answer
Create a lot-wise record of purchases and sales, apply the prescribed matching method, calculate the cost and holding period for each matched lot, and then aggregate the resulting gains or losses.
Build a Lot-Wise Purchase Record
Record each purchase date, quantity, price, charges where relevant and security identifier.
Match Sales to Purchases
For dematerialised securities, the prescribed FIFO approach can be important when matching sales to earlier acquisitions.
Calculate Each Matched Lot
Each matched lot can have a different acquisition date and cost. This can produce different short-term and long-term results within the same sale.
Corporate Actions Can Change the Lots
Bonus issues, rights issues, mergers and demergers can introduce special cost and holding-period rules.
Use Broker and Demat Records Together
A broker tax P&L is useful, but demat and transaction records can help resolve acquisition dates, quantities and corporate actions.
Important
Do not calculate the gain using only an average purchase price when the tax rules require lot-level matching.
Frequently Asked Questions
Can I use average purchase price for shares?
Do not substitute an average price where the applicable tax rules require identification of acquisition lots.
Why can one sale contain both STCG and LTCG?
If shares of the same security were acquired on different dates, the matched lots can have different holding periods.
Does FIFO apply to demat shares?
FIFO is an important transaction-matching method for securities held in dematerialised form, subject to the applicable rules.
Related EZTax Resources
- What Is Capital Gain in Income Tax?
- What Is Short-Term and Long-Term Capital Gain?
- How to Calculate Capital Gain From Shares?
- How to Report Capital Loss in ITR?
- Which ITR Form Should I Use for Capital Gains?
- Does AIS Show Capital Gains?
- Capital Gains Indexation Calculator
Official Sources
For current capital-gains and ITR guidance, refer to the Income Tax Department resources for the relevant assessment year.
Income Tax Department — ITR-2 FAQ
Income Tax Department — Set-off / Carry-forward of Losses FAQ

