Back to Blog
Accounting Basics

How to Calculate Cost of Goods Sold (COGS): Methods & Examples

Learn the COGS formula, different inventory costing methods (FIFO, WAC, specific identification), and how accounting software automates COGS tracking with real KD examples.

Ala-Hasba TeamMarch 4, 202610 min read

What Is Cost of Goods Sold?

Cost of Goods Sold (COGS) is the direct cost of the inventory items you sold during an accounting period. It includes the purchase price of the goods, plus any directly attributable costs of bringing them to their current condition and location - such as freight-in, import duties, and directly applied labor.

COGS does not include indirect operating costs like rent, salaries of your sales team, marketing, or administrative overhead. Those are operating expenses and appear separately on the income statement below the gross profit line.

Understanding COGS is essential because it directly determines your gross profit:

Gross Profit = Revenue − COGS

And your gross profit margin:

Gross Margin % = (Gross Profit ÷ Revenue) × 100

For any business selling physical goods - whether retail, e-commerce, distribution, or manufacturing - COGS is the single most important line on the income statement.

The Basic COGS Formula

The standard formula for calculating COGS over a period is:

COGS = Opening Inventory + Purchases − Closing Inventory

Let's break this down with a simple example:

  • Opening inventory (January 1): 12,000 KD
  • Purchases during January: 8,500 KD
  • Closing inventory (January 31): 9,200 KD

COGS = 12,000 + 8,500 − 9,200 = 11,300 KD

This tells you that 11,300 KD worth of inventory was consumed (sold) during January. The remaining 9,200 KD is still on hand as an asset.

Why Inventory Costing Methods Matter

The formula above is straightforward, but there is a complication: the same type of product may have been purchased at different prices over time. If you bought 100 units at 5 KD each in January and 100 more at 6 KD each in February, what is the cost of the 80 units you sold in March?

Your answer depends on which inventory costing method you use. The three main methods are:

Method Description Best For
FIFO (First In, First Out) Oldest inventory is assumed sold first Perishable goods, food, fashion
WAC (Weighted Average Cost) Average cost is recalculated after each delivery High-volume goods, interchangeable items
Specific Identification Each unit tracked individually High-value unique items: jewelry, vehicles, art

Note: LIFO (Last In, First Out) is not permitted under IFRS and therefore not used in GCC countries.

Method 1: FIFO (First In, First Out)

Under FIFO, the cost of the first units purchased is assigned to the first units sold. Your remaining inventory reflects the most recent purchase prices.

FIFO Example

A Kuwait electronics distributor has the following inventory movements for a laptop model:

Date Activity Units Unit Cost Total Cost
Jan 1 Opening stock 20 180 KD 3,600 KD
Jan 10 Purchase 30 195 KD 5,850 KD
Jan 25 Purchase 20 200 KD 4,000 KD
Jan (sales) Sold 40 units - - -

FIFO COGS for 40 units:

  • First 20 units at 180 KD = 3,600 KD
  • Next 20 units at 195 KD = 3,900 KD
  • Total COGS = 7,500 KD

Remaining inventory: 10 units at 195 KD + 20 units at 200 KD = 5,950 KD

FIFO tends to produce a higher closing inventory value (and thus lower COGS) in a rising-price environment, which shows higher profits.

Method 2: Weighted Average Cost (WAC)

Under WAC, a new average cost per unit is calculated after every purchase. All units in stock are treated as having the same average cost, regardless of when they were bought.

WAC Example

Using the same data as above:

Date Activity Units Unit Cost Running Units Running Value New WAC
Jan 1 Opening 20 180 KD 20 3,600 KD 180.00 KD
Jan 10 Purchase 30 195 KD 50 9,450 KD 189.00 KD
Jan 25 Purchase 20 200 KD 70 13,450 KD 192.14 KD
Jan (sales) Sold 40 - 192.14 KD 30 5,764 KD 192.14 KD

WAC COGS for 40 units: 40 × 192.14 = 7,686 KD

Remaining inventory: 30 × 192.14 = 5,764 KD

WAC smooths out price fluctuations, which is valuable for businesses buying large quantities of interchangeable products where tracking individual batch costs is impractical.

Method 3: Specific Identification

Each individual unit is tracked with its actual purchase cost. When a specific unit is sold, its specific cost is used for COGS.

This method is accurate but only practical for high-value, uniquely identifiable items - a jewelry shop tracking each piece by hallmark, or a car dealership tracking each vehicle by VIN number. It is impractical for a business selling thousands of identical low-value units.

What Gets Included in COGS?

Common inclusions and exclusions:

Included in COGS Excluded from COGS
Product purchase price Rent and utilities
Import duties and customs fees Sales team salaries
Freight-in (inbound shipping) Marketing and advertising
Packaging if product-specific Administrative salaries
Direct manufacturing labor Depreciation (usually in OPEX)
Supplier trade discounts (reduce cost) Outbound shipping to customers

Freight-out (shipping to your customer) is typically an operating expense - not COGS - because it is a selling cost, not a product cost.

COGS, Gross Profit, and Margin Analysis

Once you have your COGS figure, you can calculate the metrics that drive pricing and purchasing decisions:

Metric Formula What It Tells You
Gross Profit Revenue − COGS How much remains after product costs
Gross Margin % (Gross Profit ÷ Revenue) × 100 Percentage retained after COGS
Markup % (Gross Profit ÷ COGS) × 100 How much above cost you're selling

Example: Margin vs Markup

A retailer in Kuwait buys a product for 40 KD (WAC cost) and sells it for 70 KD:

  • Gross Profit: 70 − 40 = 30 KD
  • Gross Margin: (30 ÷ 70) × 100 = 42.9%
  • Markup: (30 ÷ 40) × 100 = 75%

Note that a 75% markup only produces a 42.9% margin. Many business owners confuse these two figures, which leads to incorrect pricing decisions.

Common COGS Mistakes

1. Including Operating Expenses in COGS

Misclassifying rent, utilities, or sales salaries as COGS inflates your cost figures, understates gross margin, and makes pricing analysis unreliable.

2. Forgetting Freight-In

The cost of getting inventory to your warehouse is part of the product cost and should be included in COGS. Businesses that ignore freight-in understate COGS and overstate gross margin.

3. Inconsistent Costing Methods

Switching between FIFO and WAC between periods makes your financial statements incomparable. Choose one method and apply it consistently. Under IFRS, you must disclose which method you use and apply it consistently.

4. Not Accounting for Returns and Damaged Goods

If goods are returned to you by customers, COGS must be reversed. If goods are damaged or written off, that loss should be recognized immediately - not left in inventory at full value.

5. Manual Tracking in Spreadsheets

For any business with more than a handful of products or frequent stock movements, manual COGS calculation is error-prone. Pricing decisions made on incorrect COGS data lead to selling below cost without realizing it.

How Ala-Hasba Handles COGS

Ala-Hasba uses the Weighted Average Cost (WAC) method for all inventory, which is the method recommended under IAS 2 for businesses dealing in interchangeable goods. Every COGS calculation is automatic - you never have to manually compute or enter a COGS figure.

Weighted Average Cost Built In

When you receive a stock delivery on the Stock Deliveries page, you enter the quantity and unit cost for that delivery. Ala-Hasba immediately recalculates the weighted average cost for that product by blending the new delivery cost with the existing stock value.

For example: you have 50 units in stock at an average cost of 12 KD (total value: 600 KD). You receive 30 more units at 14 KD. The new WAC is (600 + 420) ÷ 80 = 13.25 KD - and this is what the system uses for every subsequent sale.

Automatic COGS Journal on Every Sale

When a sale is recorded - whether an e-commerce order, a retail quick-sale, or a product transaction - Ala-Hasba automatically posts the COGS journal entry:

  • DR Cost of Goods Sold (account 5000): quantity sold × current WAC
  • CR Inventory (account 1200): same amount

You never touch this entry. The moment a sale is saved, the inventory value drops and COGS increases - in real time. This is the matching principle applied automatically.

Stock Deliveries with Unit Cost

On the E-commerce Stock Deliveries page, each delivery record captures:

  • Supplier
  • Product
  • Quantity received
  • Unit cost per item
  • Total delivery value

The unit cost field (mapped to the unitCost field on the StockDelivery model) is what drives the WAC recalculation. The system handles the math - you just enter what you paid.

Margin Tracking Page

The Margin page in the E-commerce module shows per-product profitability in real time:

Column What It Shows
Product Name and SKU
Units Sold Total quantity sold in the period
Revenue Total sales value
COGS Total cost of units sold (from WAC)
Gross Profit Revenue minus COGS
Margin % Gross profit as a percentage of revenue

This gives you an immediate view of which products are making money and which are selling below margin targets. Products with margins below your threshold stand out immediately.

P&L Shows COGS from the Journal

Because Ala-Hasba uses a journal-first architecture, the COGS line on your Profit & Loss report reads directly from the journal balance of account 5000. It is not estimated or approximated - it is the exact sum of every COGS journal entry posted during the period.

This means:

  • COGS is always accurate to the transaction level
  • Your gross profit on the P&L matches the margin you see on the Margin page
  • There is no reconciliation gap between your sales records and your accounting records

Retail Voiding and COGS Reversal

If a retail sale is voided in Ala-Hasba, the COGS journal is automatically reversed. The inventory value is restored and the COGS figure is reduced - keeping your stock levels and financial statements accurate without any manual correction.

Summary

COGS is the foundation of gross profit analysis and the most important number for any product-based business. The WAC method is practical, IFRS-compliant, and well-suited to businesses buying interchangeable goods in varying quantities and prices. Manual COGS tracking is error-prone and impractical at scale - accurate COGS requires a system that recalculates average cost with every delivery and posts the COGS journal automatically on every sale. Ala-Hasba does exactly this, so your margin analysis and income statement are always grounded in real, current inventory costs.

Related Articles

Accounting Basics

Cash vs Accrual Accounting: Which Should You Use?

8 min read

Accounting Basics

Chart of Accounts Setup Guide: Build the Foundation of Your Accounting System

12 min read

Accounting Basics

Double-Entry Bookkeeping: The Complete Guide for Small Businesses

9 min read

Ready to simplify your accounting?

Try Ala-Hasba free and put what you learned into practice.

Start Your Free Trial