How to Calculate Stock Cost? A Guide with Examples Using the FIFO and Weighted Average Cost Methods
How do you calculate inventory cost and the cost of goods sold? The FIFO and weighted average cost methods explained with examples, a comparison table and common mistakes.
Contents 10 sections
- What is inventory cost?
- What is included in inventory cost?
- How is the cost of goods sold (COGS) calculated?
- How is inventory cost calculated with the FIFO (first in, first out) method?
- How is the weighted average cost method calculated?
- FIFO or average cost? Which method should you choose?
- How does the year-end inventory count affect cost?
- The 7 most common mistakes in calculating inventory cost
- How do you track inventory cost regularly every month?
- Frequently Asked Questions About Calculating Inventory Cost
Your warehouse holds products left over from last month at a cost of ₺200; during the month you bought the same product first at ₺230, then at ₺260. You sold 250 units this month. What was the cost of the products sold? What is the value of the inventory you have left? The answer to how inventory cost is calculated depends on the method you use, and it can make your profit look thousands of liras different for the same product in the same month.
In this guide we explain inventory cost from start to finish: what is included in inventory cost, the formula for the cost of goods sold (COGS), the first in, first out (FIFO) method, the periodic and moving weighted average cost methods, how the methods affect profit, and why the period-end inventory count matters. Every section works through the same sample product; the figures were chosen only to illustrate the method.
What is inventory cost?
In short: Inventory cost is the amount that shows what the products you hold for sale actually cost you. It consists of the product's purchase price excluding VAT plus the purchase-related costs incurred until the product is ready for sale.
Inventory cost shows up in two places. The first is the cost of the products you sell; this amount is deducted from sales as the cost of goods sold on the income statement and determines gross profit. The second is the value of the products left at the end of the period; this amount appears as the inventory line on the balance sheet. That is why miscalculating inventory cost misstates both profit and assets.
For a general definition of cost, see what is cost; for a short summary of valuation methods, see what are the inventory valuation methods.
What is included in inventory cost?
In short: Inventory cost includes the purchase price excluding VAT and purchase-related freight, insurance, customs and similar costs; discounts on the invoice are deducted. Deductible VAT, post-sale expenses and general administrative expenses are not part of inventory cost.
Suppose you bought 200 units of our sample product. The supplier's list price is ₺44,000, and the invoice shows a ₺2,000 discount. You paid ₺3,000 in freight and ₺1,000 in insurance to get the products to your warehouse. The inventory cost of this purchase is built up as follows:
- List price (excl. VAT)₺44,000
- Invoice discount−₺2,000
- Invoice amount (excl. VAT)₺42,000
- Freight on purchase₺3,000
- Transit insurance₺1,000
- Inventory cost (unit ₺230)₺46,000
Prepared with sample values. The VAT on the invoice is deductible, so it is not added to cost.
The unit cost is 46,000 ÷ 200 = ₺230. Treating the ₺210 unit price from the invoice amount as the cost means overlooking ₺20 of expense on every product. The table below summarizes which items are and are not included in cost:
| Included in inventory cost | Not included in inventory cost |
|---|---|
| Purchase price excluding VAT | Deductible VAT |
| Freight and transit insurance on purchases | Shipping to customers (selling expense) |
| Customs duty and customs fees on imports | General expenses such as rent, staff and accounting |
| Costs such as packaging and labeling incurred to make the product ready for sale | Advertising and marketing expenses |
| Invoice discounts (deducted) | Marketplace commission (sales-related expense) |
How is the cost of goods sold (COGS) calculated?
In short: Cost of goods sold = Opening inventory + Net purchases during the period − Closing inventory. Gross profit is found by deducting COGS from sales.
- Unit cost = (Purchase price excl. VAT − discount + purchase-related costs) ÷ quantity
- Goods available for sale = Opening inventory + Net purchases during the period
- Cost of goods sold (COGS) = Goods available for sale − Closing inventory
- Weighted average unit cost = Value of goods available for sale ÷ Quantity of goods available for sale
- Gross profit = Net sales − COGS
All amounts are taken excluding VAT.
Our sample product's January movements are as follows. There are 400 units available for sale during the month; 250 units are sold and 150 units remain in inventory. The selling price is ₺400 excluding VAT, so net sales are 250 × 400 = ₺100,000.
| Date | Action | Count | Unit cost | Amount | Units in inventory |
|---|---|---|---|---|---|
| January 1 | Opening inventory | 100 | 200 ₺ | 20.000 ₺ | 100 |
| January 10 | Purchase | 200 | 230 ₺ | 46.000 ₺ | 300 |
| January 15 | Sales | 150 | depends on method | depends on method | 150 |
| January 20 | Purchase | 100 | 260 ₺ | 26.000 ₺ | 250 |
| January 25 | Sales | 100 | depends on method | depends on method | 150 |
| Goods available for sale | 400 | 92.000 ₺ | |||
The value of goods available for sale is the same under every method: ₺92,000. The only thing that changes is how much of this amount is allocated to the 250 units sold and how much to the 150 units left in inventory. The inventory valuation method makes this allocation.
Product pageFree Bookkeeping SoftwareHow is inventory cost calculated with the FIFO (first in, first out) method?
In short: Under FIFO, the products bought first are assumed to be sold first. The cost of the oldest purchases is assigned to the products sold, and the cost of the newest purchases to closing inventory.
In the example, the 250 units sold are covered starting from the oldest layer:
- From opening inventory: 100 units × ₺200 = ₺20,000
- From the January 10 purchase: 150 units × ₺230 = ₺34,500
- Cost of goods sold: 20,000 + 34,500 = ₺54,500
- Closing inventory: the remaining 50 units from the January 10 purchase × ₺230 = ₺11,500 and the entire January 20 purchase of 100 units × ₺260 = ₺26,000; total ₺37,500
Check: 54,500 + 37,500 = ₺92,000. Gross profit is 100,000 − 54,500 = ₺45,500, and the gross profit margin is 45.5%. FIFO is the method closest to the physical flow of goods: most businesses sell older stock first, especially for products with an expiry date or that go out of fashion.
How is the weighted average cost method calculated?
In short: Under the weighted average cost method, the total value of goods available for sale is divided by the total quantity, and every product is valued at this average cost. If the average is calculated once at the end of the period, it is called the periodic weighted average; if it is recalculated after every purchase, it is called the moving weighted average.
Periodic weighted average
The average unit cost is 92,000 ÷ 400 = ₺230. Cost of goods sold is 250 × 230 = ₺57,500, and closing inventory is 150 × 230 = ₺34,500. Gross profit is ₺42,500, and the gross profit margin is 42.5%.
Moving weighted average
Under the moving method, a new average is calculated after every purchase, and each sale is costed at the average at that moment. Most inventory software works this way, because it gives an up-to-date unit cost at any time.
| Date | Action | Movement value | Units in stock | Inventory value | Average unit cost |
|---|---|---|---|---|---|
| January 1 | Start of period | 20.000 ₺ | 100 | 20.000 ₺ | 200 ₺ |
| January 10 | Purchase of 200 units | +46.000 ₺ | 300 | 66.000 ₺ | 220 ₺ |
| January 15 | Sale of 150 units | −33.000 ₺ | 150 | 33.000 ₺ | 220 ₺ |
| January 20 | Purchase of 100 units | +26.000 ₺ | 250 | 59.000 ₺ | 236 ₺ |
| January 25 | Sale of 100 units | −23.600 ₺ | 150 | 35.400 ₺ | 236 ₺ |
Cost of goods sold is 33,000 + 23,600 = ₺56,600, and closing inventory is ₺35,400. Gross profit is ₺43,400, and the gross profit margin is 43.4%. The check balances again: 56,600 + 35,400 = ₺92,000.
Recommended ReadingHow to Calculate Profit Margin?FIFO or average cost? Which method should you choose?
In short: When prices are rising, FIFO shows a lower cost of goods sold and higher profit; average cost smooths out price fluctuations. In Turkey, the FIFO and average cost methods are used for tax purposes; last in, first out (LIFO) is not accepted for tax purposes.
In the example, purchase prices rose from ₺200 to ₺260 during the month. Putting the results of the four methods side by side makes the difference clear. We added LIFO, applied at the end of the period, only for comparison:
| Method | Cost of goods sold | Closing inventory | Gross profit | Gross profit margin |
|---|---|---|---|---|
| FIFO (first in, first out) | 54.500 ₺ | 37.500 ₺ | 45.500 ₺ | %45,5 |
| Moving weighted average | 56.600 ₺ | 35.400 ₺ | 43.400 ₺ | %43,4 |
| Periodic weighted average | 57.500 ₺ | 34.500 ₺ | 42.500 ₺ | %42,5 |
| LIFO (for comparison, periodic) | 60.500 ₺ | 31.500 ₺ | 39.500 ₺ | %39,5 |
- FIFO₺54,500
- Moving weighted average₺56,600
- Periodic weighted average₺57,500
- LIFO (not accepted for tax purposes)₺60,500
Example: 400 units of goods available for sale (₺92,000), 250 units sold, with the purchase price rising from ₺200 to ₺260 during the month.
- ₺92,000goods available for sale; the same under every method
- 45.5%gross profit margin with FIFO
- 42.5%gross profit margin with periodic average
- ₺3,000difference in gross profit between the two methods
The higher profit FIFO shows when prices are rising also means a higher tax base; when prices fall, the picture reverses. Whichever method you choose, the main rule is consistency: the method should be applied the same way every period, and any change should be reviewed with your certified public accountant (mali müşavir) beforehand. It is best to clarify the tax rules on choosing and changing methods for your own situation with your accountant.
| FIFO | Weighted average | |
|---|---|---|
| Logic | First bought, first sold | Every product is valued at average cost |
| Profit when prices rise | Looks higher | Looks more balanced |
| Closing inventory | Close to current prices | Average of old and new prices |
| Tracking effort | Each purchase layer is tracked separately | A single average is tracked |
| Best suited for | Products with an expiry date, seasonal or fast-aging products | Products that cannot be told apart and are bought frequently |
How does the period-end inventory count affect cost?
In short: Because the cost of goods sold is found by deducting closing inventory, every product undercounted increases cost and reduces profit by the same amount; every product overcounted makes profit look higher than it is.
In the example, closing inventory under FIFO is 150 units and ₺37,500. If 10 units are undercounted, closing inventory at the last purchase price comes out 10 × 260 = ₺2,600 lower. This ₺2,600 is added to the cost of goods sold, and gross profit drops from ₺45,500 to ₺42,900. Conversely, products that appear in the records but are not in the warehouse inflate profit and surface as a surprise cost in the next period.
That is why finding the reason for the difference between the count and the records (shrinkage, damage, recording error, loss) is at least as important as the count itself. Recording inventory movements regularly reduces the chance of facing large differences at the end of the period. For ways to reduce the cost of products sitting in inventory, see our article on ways to reduce inventory costs.
The 7 most common mistakes in calculating inventory cost
In short: The most common mistakes are not adding freight on purchases to cost, treating VAT as cost and taking the invoice price as the unit cost.
- Treating the invoice price as unit cost. If freight, insurance and customs are not added, the unit cost looks lower and profit looks higher than they are.
- Adding deductible VAT to cost. For a VAT-registered business, input VAT is not a cost; if it is added to cost, profit looks lower than it is.
- Not deducting discounts. If the invoice discount or a price difference received later is not deducted from cost, cost is inflated.
- Including selling expenses in inventory cost. Shipping to customers, commissions and advertising are selling expenses; they are recorded as period expenses, not as inventory cost.
- Changing the method from period to period. Costs calculated with FIFO one month and average cost the next cannot be compared.
- Entering inventory movements in bulk and late. Order matters in the moving average; if purchases are entered late, sales are costed at the wrong average.
- Not recording count differences. If the difference between the records and the warehouse is not corrected, profit and inventory value do not reflect reality.
How do you track inventory cost regularly every month?
In short: For regular tracking, every purchase is recorded on time together with its purchase-related costs; sales are deducted from the same system; at month-end a count is done, differences are corrected and a product-level cost report is pulled.
- 01Record purchasesEnter every purchase invoice with its amount excluding VAT and its discount.
- 02Add costsAllocate freight, insurance and customs to the relevant products.
- 03Deduct salesDeduct sales from inventory in the same system, in the order they occur.
- 04CountCount at month-end, find the reasons for differences and correct them.
- 05ReportPull a product-level cost and gross profit report.
As long as purchases, sales and warehouses are kept in separate spreadsheets, these steps take hours every month. NetKasam inventory management lets you calculate your inventory costs and see inventory movements in full detail on a single screen; you also track your inventory turnover rates and critical stock level reports from the same place. If you work with more than one warehouse or branch, branch and warehouse management lets you track inventory from one place, transfer between warehouses and report on each warehouse separately. In the Reports section you can pull and save reports with any filter you like and export them to Excel. Bookkeeping and the e-Invoice system are always free.
Frequently Asked Questions About Calculating Inventory Cost
How do you calculate inventory cost?
Deduct discounts from the purchase price excluding VAT, add purchase-related expenses such as freight, insurance and customs, and divide the total by the number of units. If the same product was bought at different prices, the cost of the units sold and those remaining in stock is determined with the FIFO or average cost method.
What is the formula for the cost of goods sold?
Cost of goods sold = Opening inventory + Net purchases during the period − Closing inventory. Gross profit is found by deducting the cost of goods sold from net sales.
What is the FIFO method?
It means first in, first out. The products bought first are assumed to be sold first; the cost of the oldest purchases is assigned to the products sold, and the cost of the newest purchases to closing inventory.
How is weighted average cost calculated?
The total value of goods available for sale is divided by the total quantity. If the average is calculated once at the end of the period, it is the periodic weighted average; if it is recalculated after every purchase, it is the moving weighted average.
Can the LIFO method be used in Turkey?
The last in, first out (LIFO) method is not accepted for tax purposes. In Turkey, the first in, first out (FIFO) and average cost methods are used for tax purposes.
Is freight added to inventory cost?
Freight on purchases, meaning the amount paid to move the product from the supplier to your warehouse, is added to inventory cost. Shipping paid to send orders to customers is a selling expense and is not added to inventory cost.
Is VAT included in inventory cost?
For a VAT-registered business, input VAT on purchases is deductible, so it is not included in inventory cost. Inventory cost is calculated on amounts excluding VAT.
Which inventory valuation method should I choose?
FIFO is common for products whose physical flow is first in, first out, products with an expiry date, and seasonal products; weighted average is common for products that cannot be told apart and are bought frequently. The chosen method should be applied the same way every period and decided together with your certified public accountant (mali müşavir).
Inventory cost is the foundation of profit calculation: if cost is wrong, margin, pricing and campaign decisions will be wrong too. Open the latest purchase invoices for your five best-selling products this month, calculate the true unit cost by adding freight and deducting discounts, and compare it with your selling price. More often than not, you will find that your margin is different from what you thought.
Bookkeeping Is Now Completely Free
Manage your bookkeeping and e-Invoice operations with NetKasam without paying a thing. Customer and supplier accounts, inventory, collections and more in one panel, completely free.