Instructions to Cost Goods and Achieve Optimal Gross Profit!
On any income statement, the cost of goods sold (COGS) is a linchpin figure. It is the direct expense of producing the products a company sells during a period. It's important to understand how to calculate cost of goods sold for pricing, profitability analysis, tax reportingnd inventory valuation. In this guide we go through the cost of goods sold formula, what to include, examples and a few useful tips to help you calculate COGS with confidence.
What COGS comprises — and why it's important
COGS contains only expenses tied to producing and purchasing the items that were sold. For a merchandiser, that is usually the cost to purchase inventory plus shipping and handling in. For a manufacturer, COGS is comprised of raw materials and direct labor and manufacturing overhead applied to goods sold. Indirect expenses — such as the general administrative payroll, marketing or rent on the corporate office — are excluded.
An accurate COGS figure has an impact on a companys gross profit or loss, its taxable income and the valuation of the inventory. When COGS is understated, gross profit and taxable income are overstated. If COGS is exaggerated, you could be underreporting profit and making bad pricing or purchasing decisions.
The standard cost of goods sold formula
The most common formula for calculating cost of goods sold is:
Opening Stock + Net Purchases - Closing Stock = Cost of Sales
This is a relevant equation for businesses that are purchasing finished goods for resale and many manufacturing business when adjusted for production. “Purchases (Net): Purchases includes purchase cost and freight-in, less any purchase returns or discounts netted.
Step-by-step COGS calculation example
Identify the "beginning inventory":
This is the worth of a company's inventory at the very beginning of an accounting period, according to its balance sheet. Example: $10,000.
Add net purchases for the period:
Purchases less returns and allowances plus freight-in. e.g. purchase $25,000; purchase returns $1,000; freight-in $500 → net purchases = $24,500.
Calculate goods available for sale:
beginning inventory + net purchases = $10,000 + $24,500 = $34,500.
Deduct ending inventory:
take a physical count or refer to your perpetual records to establish the value of goods left at the end of the period. Example ending inventory = $8,000.
plug in the numbers:
COGS = $34,500 – $8,000 = $26,500.
This is an example to find out how inventory value and purchase are flowing into cost of goods sold.
Allocating joint costs and byproducts
When a single production process yields multiple products, you cannot assign costs the same way you would for a product made in isolation. Joint cost allocation is what ensures each product carries a fair share of the shared production costs, which matters for accurate COGS reporting, pricing decisions, and inventory valuation. The two main approaches are physical-measure allocation (based on weight, volume, or units) and value-based allocation using market prices at the split-off point. Neither is perfect, but each has situations where it fits better. Document your choice, review it annually, and update when your production mix changes
- Choose between physical-measure and value-based allocation based on what best reflects actual consumption
- Review your allocation method annually and whenever product mix or process yields change significantly
- For byproducts, consider net realizable value rather than treating them the same as primary products
- Avoid inflating primary product COGS with low-value byproduct residuals after disposal costs
- Align your allocation method with external reporting standards so financial statements hold up to scrutiny
Inventory Systems, their effect on COGS
There are two types of inventory accounting methods: periodic and perpetual.
Perpetual inventory:
A physical count at the end of a period is taken to help establish ending inventory and COGS through the basic equation. This is typical for small retailers.”
Moving average inventory:
inventory and COGS reflect continuous updates as sales and purchases are made, with records of the quantity and cost per unit.
COGS is also influenced by the inventory methods of accounting – FIFO, LIFO and weighted average. Under FIFO (first-in, first-out), the older costs go to COGS. Under the LIFO (last-in, first-out) method, the latest costs go to COGS first. Weighted average smooths out cost changes by applying all costs of goods available for sale. The method used affects COGS and ending inventory amounts, even if the units movement is not altered.
Including manufacturing costs in COGS
For producers, COGS come from attributing the cost of production to products that are manufactured and sold. The manufacturing form of the formula, which is how most companies would use it, begins with beginning finished goods inventory and adds cost of goods manufactured (raw materials used plus direct labor plus manufacturing overhead applied), then subtracts ending finished goods inventory. The calculation of cost of goods manufactured itself takes into account corrections for the WIP inventory.
Activity-based costing for COGS
Applying a single blanket overhead rate works fine for simple operations. But when your products vary significantly in complexity, assembly time, or shared resource consumption, a blanket rate will consistently over-cost some products and under-cost others. Activity-based costing solves this by assigning overhead based on what each product actually draws from each cost pool. For companies with complex assemblies or shared utilities, ABC often reveals margin differences that standard costing methods completely miss. It takes more effort to set up, but the pricing and product mix decisions it enables more than justify that investment. Here is how to do it well
- Identify the major activities and cost pools that drive overhead in your production process
- Choose cost drivers that have a genuine measurable correlation with overhead consumption
- Test your driver selection before committing by checking how well it predicts actual overhead
- Run a full reconciliation after implementation to make sure ABC results agree with your financial statements
- Use the output to make better pricing, cost reduction, and product mix decisions rather than just for reporting
Per-unit COGS and pricing decisions
When you have total COGS, you can get per-unit COGS by dividing total COGS by the number of units sold during that time. Per-unit COGS is used to establish price and calculate your gross margin percentage. For example, if per unit is $15 and you want a 40% GM then $15 / (1 - margin) = $25 Thought dirty) getPrice So Margin-led pricing: Simple Target Price = Cogs/ 1- margin COGS/ 0.60 = target price
Inventory turnover and liquidity metrics
Inventory turnover is one of the most direct connections between your COGS and your working capital position. High turnover means inventory is converting to cash quickly. Low turnover means cash is sitting tied up in stock, which affects liquidity, inflates carrying costs, and can distort your COGS per period if volumes shift. Days Sales of Inventory, which divides average inventory by daily COGS, gives you a time-based view that is particularly useful for cash flow forecasting and supplier negotiations. Review it monthly at the product level, not just in aggregate
- Track inventory turnover by product category so you know where slow-moving stock is accumulating
- Use Days Sales of Inventory to support cash forecasting and inform procurement cadence
- Set KPI targets by product line and use them to trigger replenishment and markdown decisions
- Tie replenishment timing to lead times to improve liquidity without compromising service levels
- Review supplier terms regularly to reduce carrying costs on slower-moving lines
Common adjustments and considerations
Freight-in: Add the cost of getting the goods to your location to purchases.
Purchase returns and allowances: Deduct these when calculating net purchases.
Factory overhead: For and by Manufacturer [Allocate prospective, fixed/fixed type overhead where there is a logical driver (machine hours, labour hours etc.)].
Obsolete or damage inventory: Reduce inventory to NRV, which creates a write-down and either increases COGS or recorded as loss separately under accounting policy.
Inventory shrinkage: Ending inventory is drained by theft, breakage and unreported usage; this raises COGS; find shrinkage with periodic counts.
Using barcode and RFID to reduce shrinkage
Manual inventory tracking creates gaps. Data entered by hand is delayed, prone to error, and often incomplete, which means shrinkage can go undetected for extended periods before it shows up in your COGS. Barcode scanning and RFID automate the capture, speed up counts, and give you timely, accurate data to close your books faster. RFID goes further by tracking movement through production lines and warehouses without requiring line-of-sight scans, which makes it particularly useful for detecting unlogged usage or shrinkage as it happens rather than after the fact. Choose the right technology for your environment
- Pilot barcode or RFID scanning in one warehouse location before committing to a full rollout
- Choose tags and readers that match your environment in terms of range, durability, and system integration
- Plan for tag replacement schedules to avoid data gaps from degraded or missing tags
- Combine scanning data with cycle count results and exception reports to focus investigations
- Feed loss analytics back into supplier quality reviews so recurring issues are addressed at the source
Journal entries and reporting
End-of-period adjusting entry In a periodic system, the end-of-period adjusting entry takes beginning inventory plus purchase minus ending inventory to COGS. In a periodic system, for each sale you'd debit inventory and credit COGS corresponding to the item sold.
Reconciling supplier invoices and accruals
Closing the books with accurate COGS requires more than just counting inventory. It requires matching what you received against what you were billed, and accruing for anything received but not yet invoiced. Skip this and you end up understating COGS in one period and overstating it in the next when the invoice finally arrives. A clear three-way match process for purchase orders, receiving records, and invoices is the foundation. Escalate unresolved discrepancies to procurement before the period closes rather than letting them drift into the next period. Build these habits in
- Run a three-way match on purchase orders, goods received, and invoices before each period close
- Accrue expected costs when goods are received so COGS is not understated while invoices are in transit
- Catch price and quantity discrepancies early rather than discovering them after the period has closed
- Escalate unresolved items to procurement so they do not carry over and distort multiple periods
- Use supplier portals and electronic invoicing to speed confirmations and reduce manual reconciliation
How to make sure COGS is calculated correctly
Maintain readable, current records of purchase and freight.
Balance stock and ledger items on a consistent basis.
Select an inventory valuation method appropriate for your business and tax situation, and then use it consistently.
Separate direct costs of production from indirect overhead to prevent misclassification.
Apply unit costing to those products with significant variation in cost or use activity-based allocation for more complex overhead.
Forecasting COGS for pricing models
Good pricing decisions require forward-looking COGS, not just historical averages. Supplier rate changes, commodity price swings, planned promotions, and minimum order quantity effects all shift your costs, and if your pricing does not reflect them in advance, margins erode before you have a chance to respond. Build a baseline COGS forecast from historical data, then layer in known contracts, expected freight moves, and seasonal demand patterns. Use scenario modeling to show how margins change at different price points. Share the output broadly
- Build a baseline COGS forecast from historical data and then layer in supplier contracts and freight expectations
- Account for lead time variability and buffer stock policies when projecting future cost levels
- Use scenario modeling to show margin changes at different price points before pricing decisions are made
- Present probability-weighted outcomes to executives so decisions reflect the range of possible costs
- Share forecasted COGS with sales, procurement, and finance so minimum margin rules are set consistently
Common mistakes to avoid
- Excluding freight-in or purchase discounts from net purchases.
- Neglecting to consider returned goods or allowances in calculation of net purchases.
- The practice of applying different inventory valuation models throughout the periods, which confuses trend analysis.
- Blurring operating expenses and COGS—Only direct product costs should be in COGS.
COGS benchmarking and KPIs
Benchmarking your COGS against industry peers and your own historical performance helps you spot when your cost structure is drifting out of line. A spike in overhead per unit, a rising labor ratio, or a gross margin that is quietly compressing are all things that a well-designed KPI set will flag before they become a serious problem. The key is to set targets that are realistic for your scale and operating model, not just copied from industry averages that may reflect a completely different setup. Use dashboards to track trends and investigate root causes cross-functionally. Track these
- Monitor gross margin percentage as a primary COGS indicator and set alert thresholds for compression
- Track inventory turnover and direct labor hours per unit alongside overhead per unit of output
- Exclude one-off restructuring costs from comparisons so trend data reflects ongoing performance
- Use dashboards to surface KPI breaches and assign ownership for root cause investigation
- Document corrective actions taken so the same cost drivers do not trigger the same problems twice
Putting it into practice
To determine the COGS that you will claim for your next reporting period, you will need to obtain beginning inventory, all purchase invoices, freight and handling information and a dependable ending inventory valuation. Utilize COGS formula, inventory method and add assumptions. Review gross profit margin and compare to historical periods to identify discrepancies or errors in costing.
Software tools and integrations
Modern ERP and inventory management systems can automate most of the heavy lifting in COGS tracking: posting costs at point of sale, reconciling inventory ledgers to physical counts, and handling multi-currency valuation for global operations. The question is not whether to use software, but which features matter most for your specific operation. Look for systems with multi-layer costing, batch traceability, and APIs that connect to your shipping, manufacturing, and procurement platforms without requiring manual exports. Cloud solutions reduce infrastructure overhead and support real-time analytics, but review data privacy and retention policies carefully
- Choose systems that support multi-layer costing and can handle the complexity of your production model
- Look for built-in batch traceability if you operate in regulated industries or need FIFO accuracy
- Prioritize pre-built connectors for your key platforms to minimize custom integration work
- Plan integrations and test cost posting scenarios before go-live to avoid close cycle disruptions
- Automate reconciliations where possible to shorten close cycles and keep operational and financial records aligned
Conclusion
Understanding how to compute cost of goods sold is a valuable skill that enhances financial transparency. With correct COGS: You will have a clearer visibility to gross profit; you can make better decisions about pricing and purchasing, and report accurate financial statements. Whether you calculate your COGS using a basic period formula or a full-on manufacturing costing system, the key to accurate COGS calculation is due diligence and good record maintenance.