# How is the Average cost calculated?

Average cost is calculated on FIFO(first in first out) basis of buying and selling. While the total value (Quantity*Avg Cost) is called as holding cost. Let’s understand this calculation by taking an example:

On 1st Sep:

200Rs. 1025Rs. 2,05,000
• Orders placed: 1st order: Quantity = 150 | Cost = Rs. 1000
• 2nd order: Quantity = 50 | Cost = Rs. 1100

To calculate the average cost, first calculate the value (Quantity x Cost). Hence:

• Total quantity = 200
• Total value: Rs. 2,05,000
• Divide total value by total quantity:
• Rs. 2,05,000 ÷ 200 = Rs.1025 is the average cost

While the holding cost, now let us see what happens when you add a sell order to this.

On 10th Sep:

150

50

200

100

200Rs. 1025Rs. 2,05,000
10 SepSell100Rs. 1200Rs. 1,20,000

Sell order placed on 10th Sep: 100 (out of 200) at Rs. 1200

Now the FIFO method will be applied here. The method will check the first trade (on the buy-side). In this case, it is 150. 100 will be deducted from 150. The balance left is shown below.

After applying the FIFO method, Balance: 150 - 100 = 50