How to Accurately Calculate COGS: Formulas & Examples

How to Accurately Calculate COGS: Formulas & Examples

In managing a business, understanding financial health begins with one critical figure: Cost of Goods Sold (COGS). Many first-time entrepreneurs fall into the trap of setting selling prices solely based on market rates, without truly understanding how to calculate COGS accurately.

As a result, even when sales figures appear impressive, net profits may be negligible—or worse, the business may operate at a loss.

This article provides a comprehensive breakdown of the concept of COGS, its core components, and the technical steps required to calculate it properly, ensuring your business is built on a solid financial foundation.

What Is COGS (Cost of Goods Sold)?

COGS, in simple terms, represents the total direct costs incurred by a company to produce the goods or services sold during a specific accounting period. In international accounting terminology, this is known as Cost of Goods Sold (COGS).

COGS is far more than just a line item in the income statement. Understanding how to calculate it accurately is essential because:

  • Pricing Strategy: You cannot define a sustainable profit margin without knowing your true cost base.
  • Operational Efficiency: If your COGS is disproportionately high compared to industry benchmarks, it signals inefficiencies within your production process.
  • Tax Accuracy: COGS directly reduces gross revenue to determine taxable income.

Core Components of the COGS Formula

Before working with numbers, it is crucial to understand which elements are included in COGS in accounting. Generally, there are three primary components:

1. Raw Material Costs

These are the fundamental costs of all materials used to create a product. For example, if you sell bread, flour, eggs, and sugar constitute your raw material costs.

2. Direct Labor Costs

This category includes wages paid to employees directly involved in the production process. Administrative staff salaries are excluded; instead, this covers machine operators, technicians, or chefs.

3. Manufacturing Overhead

Overhead refers to indirect costs that support production activities, such as factory electricity, machine depreciation, or equipment maintenance expenses.

COGS Component Cost Examples
Raw Materials Wood (furniture), Fabric (garment manufacturing)
Direct Labor Tailors, Assembly line operators
Overhead Factory rent, Machine electricity, Packaging costs

The Basic Formula for Calculating COGS

For trading companies, the COGS formula is relatively straightforward, as there is no transformation of raw materials into finished goods. The standard formula is:

COGS = (Beginning Inventory + Net Purchases) – Ending Inventory

Variable Explanation:

  • Beginning Inventory: The value of inventory on hand at the start of the accounting period (month or year).
  • Net Purchases: Total merchandise purchases plus freight-in costs, minus purchase returns and discounts.
  • Ending Inventory: The value of inventory remaining in storage at the end of the period.

Step-by-Step Guide to Calculating COGS

To avoid critical errors in your financial statements, follow this structured COGS calculation process:

  1. Calculate Net Sales: Total sales minus returns and discounts.
  2. Determine Beginning Inventory: Refer to the balance sheet from the previous period.
  3. Aggregate Purchases During the Period: Include all purchase invoices for the current month or year.
  4. Adjust for Freight and Discounts: Add shipping costs and subtract supplier discounts.
  5. Conduct a Physical Stock Count: Perform a stock opname to determine ending inventory.
  6. Apply the COGS Formula: Insert the figures into the main COGS equation.

COGS Calculation Example: A Practical Case

1. Trading Company Example

“Langkah Maju” Shoe Store reports the following data for January:

  • Beginning Inventory: IDR 50,000,000
  • January Purchases: IDR 100,000,000
  • Freight-in Costs: IDR 2,000,000
  • Ending Inventory: IDR 30,000,000

Calculation:

  • Net Purchases = IDR 100,000,000 + IDR 2,000,000 = IDR 102,000,000
  • COGS = (IDR 50,000,000 + IDR 102,000,000) – IDR 30,000,000
  • COGS = IDR 122,000,000

2. Manufacturing Company Example

In manufacturing, you must first calculate the Cost of Production (raw materials + direct labor + overhead). If total production costs amount to IDR 200 million, with beginning finished goods inventory of IDR 20 million and ending inventory of IDR 10 million, the resulting COGS is IDR 210 million.

How to Calculate COGS in Excel / Google Sheets

Many business owners seek Excel-based COGS calculation examples for automation. Below is a simple template setup:

  1. Create Column A for Account Names and Column B for Monetary Values.
  2. Cell B1: Enter Beginning Inventory.
  3. Cell B2: Enter Total Purchases.
  4. Cell B3: Enter Freight-in Costs.
  5. Cell B4: Enter Returns/Discounts (as negative values).
  6. Cell B5 (Net Purchases): Use the formula =SUM(B2:B4).
  7. Cell B6: Enter Ending Inventory.
  8. Cell B7 (COGS): Use the formula =(B1+B5)-B6.

With this template, you only need to update the figures monthly to obtain instant results.

How COGS Impacts Net Profit

COGS is the first deduction from revenue. The relationship can be summarized as follows:

  • Gross Profit = Sales – COGS
  • Net Profit = Gross Profit – Operating Expenses (office salaries, marketing, etc.)

When you successfully reduce COGS—for instance, by sourcing more cost-effective yet high-quality suppliers—your Gross Profit automatically increases. This is why the impact of COGS on profitability is a critical concern for financial managers. Uncontrolled COGS will erode your margins long before operating expenses are even addressed.

FAQ (Frequently Asked Questions)

1. What is the difference between COGS and overhead costs?

COGS represents the total cost (including overhead) associated with producing goods that are sold. Overhead costs are one component of COGS and consist of indirect expenses such as electricity or facility maintenance.

2. How is COGS calculated for service-based businesses?

Service companies do not hold physical inventory, so they typically use the term “Cost of Services.” The calculation focuses primarily on professional labor costs and tools used to deliver the service.

3. When should COGS be updated in financial statements?

COGS must be updated each time an income statement is prepared—commonly on a monthly, quarterly, or annual basis.

4. Why is ending inventory subtracted in the COGS formula?

Because unsold inventory has not yet generated revenue, its cost should not be recognized as an expense in the current period. Instead, it becomes beginning inventory for the next period.

Conclusion: Optimizing COGS for a More Sustainable Business

Mastering how to calculate COGS is the first step toward effective financial management. With accurate COGS figures, you can set competitive pricing strategies, manage inventory efficiently, and ensure that reported profits are genuinely realized.

However, manually calculating COGS in Excel is often prone to human error, especially for businesses with thousands of SKUs or complex production workflows. For real-time, automated accuracy, adopting an ERP (Enterprise Resource Planning) system is the most reliable solution.

Optimize Your COGS Calculation with SAP Business One

Do not let COGS miscalculations hinder your business growth. SAP Business One from PT Sterling Tulus Cemerlang (STEM) delivers an intelligent solution to automate your accounting and manufacturing processes.

With SAP Business One, you can:

  • Automatically and accurately calculate COGS (FIFO, Moving Average, or Standard Costing).
  • Integrate warehouse inventory data with financial reports in real time.
  • Monitor profit margins per product with a single click.

Ready to elevate your business with greater financial transparency?
👉 Contact PT Sterling Tulus Cemerlang today for a Free Consultation & SAP Business One Demo!

What is SAP Business One?