Cost of Goods Sold Formula | How to Calculate COGS, with Examples

Cost of Goods Sold Formula | How to Calculate COGS, with Examples

Table of Contents
Table of Contents

How do you know your business is not bleeding money when you make a sale? One way is to ensure that the selling price is more than the cost of the goods sold, aka COGS. To know this number, though, you'd need to know the Cost of Goods Sold formula.

But before we jump into formulas and calculations, here is a question for you.

Why do you even need to know COGS?
Why can't you just look up the last vendor bill and check the purchase price?

Why You Need to Calculate Cost of Goods Sold

To answer this, let's see how a business like yours might be managing goods & inventory in real life.

Inventory is always in a state of flux.

A trading company would procure the required stock from a few trusted suppliers and then ship it to interested buyers.

A manufacturing company would procure the raw materials from their suppliers before processing the individual items to create their end product.

So inventory is either being procured, processed, or being shipped out. This is the basis of inventory management.

The last item you sold may have been purchased at a different price than the other stock for the same product six months ago.  And there is no way you'd remember what that specific price was.

Also, procuring or manufacturing the items & goods would incur additional costs, e.g., shipping, freight, labor, processing, duty, and handling costs. These costs could be different for each item in your inventory.

Remembering or finding out the costs associated with every stock item in your warehouse would be difficult and, might I add, a waste of your time.

This is why you need the formula to calculate COGS. Knowing and using the formula makes it easy for you to get the correct cost numbers without doing a manual calculation for each item purchased.

It is a lot easier to work with aggregate numbers. You can quickly find out the overall inventory levels at any point in time, the total amount you have spent procuring all the stock for a particular item, and know how much you spent processing, shipping, or manufacturing the entire inventory.

As we shall see later, this aggregate information is used in the formula for calculating the Cost of Goods Sold for both manufactured items and traded items and is a lot easier to work with.

Let us first look at the accepted definition of COGS.

What is Cost of Goods Sold (COGS)

Cost of Goods Sold (COGS) calculates the total cost incurred in getting the product ready for sale in the market. However, COGS doesn't include all the costs incurred while running the business. It mainly comprises direct expenses incurred in making the finished product or getting it to your customer.

The cost of goods sold is deducted from the total sales amounts to calculate gross profit.

COGS also appears in, and impacts your income statement, and hence overall profitability.

Cost of Goods Sold Formula

Cost of Goods Sold = (Beginning Inventory Value - Ending Inventory Value) + Total Inventory Purchases + Any additional Direct Costs

Here is an explanation of the various items in the formula.

Period or Accounting Period is the duration or period for which you want to calculate the Cost of Goods Sold. Typically this would be a month, or a quarter, or a year, but it could be any period you choose.

Beginning Inventory Value is the total stock level at the start of the period you have selected.

Ending Inventory Value is the total stock level at the end of the period you have selected.

The opening and closing value will depend on the type of inventory valuation method you use. The three most common ones are:



3) Avg Cost

Total Purchase Value of Inventory is the sum-total amount you paid your suppliers to purchase the inventory or raw materials in this period.

Additional Direct Costs are the costs you incurred over and above what you paid to the suppliers to get your product ready for sale.

If you shipped the items to your warehouse and paid the logistics provider, that is an additional direct cost.

If you processed the raw materials using machines, the cost of operating those machines is an additional direct cost. Note: the cost of the device itself is not a direct cost.

Examples of direct costs include:

  1. Factory overhead like utilities for the manufacturing site
  2. Storage cost
  3. Cost of raw material
  4. Freight and shipping charges
  5. Direct labor costs
  6. Cost of inventory parts used to make the finished product
  7. Other supplies such as packaging material

There are hidden inventory costs as well that you may want to include in this category.

Let us look at an example where we calculate COGS using this formula.

Cost of Goods Sold Formula with an Example

ABC Company buys laptops from suppliers and sells them from its website.

Their previous financial year ended on 31 December 2019. On 1 January 2021, they had 50 laptops worth $25,000, which they had procured at $500 each.

At the beginning of the year, ABC purchased 100 laptops at $600 each.

During the rest of the year, ABC sold 120 laptops at $1,000 each.

At the end of the year, they had 30 laptops left.

They paid $5 for each laptop they purchased in 2021 for shipping from the supplier to their warehouse.

The cost of shipping the sold laptop to their customers was approximately $10 per laptop.

Let us calculate the Cost of Goods Sold, or COGS, using the formula we defined above. We will use the same scenario with FIFO and LIFO to understand how COGS changes with the inventory valuation method.

Period - 2021

Beginning Inventory = 50 laptops

Beginning Inventory Value = $25,000 (at $500 each)

Laptops Purchased = 100 (at $600 each)

Laptops Sold = 120

Total Sales = 120 X $1,000 = $120,000

Closing Inventory = Opening laptops + Purchased laptops - Sold laptops = 50 + 100 -120 = 30 laptops

Closing Inventory Value [FIFO] = 30 X $600 = $18,000

Closing Inventory Value [LIFO] = 30 X $500 = $15,000

Closing Inventory Value [Avg Cost] = 30 X $566.67 = $17,000

Direct Cost for Shipping [FIFO] = (70 X $5) + (120 X $10) = $1,550

Hold on. Where did that 70 come from?

In FIFO (First In First Out), the older stock is always sold first. When ABC sold 120 laptops, they first exhausted the 50 laptops they had from 2020 before selling the new ones (70 of them).

Since the Cost of Goods Sold formula calculates the cost ONLY for the items sold, we should not add shipping charges for the 30 laptops in the warehouse.

Direct Cost for Shipping [LIFO] = (100 X $5) + (120 X $10) = $1,700

In LIFO (Last In First Out), the newest stock is sold first. When ABC sold 120 laptops, they exhausted the 100 they bought and then sold the older stock. Since we sold all the new laptops, their respective shipping charges are added to the direct cost.

So we have all the pieces in place. Now lets us apply the COGS formula and see the results.

Cost of Goods Sold = (Beginning Inventory Value - Ending Inventory Value) + Total Inventory Purchases + Any additional Direct Costs for selling

Cost of Goods Sold [FIFO] = ($25,000 - $18,000) + $60,000 + $1,550 = $68,550

Cost of Goods Sold [LIFO] = ($25,000 - $15,000) + $60,000 + $1,700 = $71,700

Gross Profit [FIFO] = $120,000 - $68,550 = $51,450

Gross Profit [LIFO] = $120,000 - $71,700 = $48,300

Author's Note: In this example, you can see how FIFO generally gives higher gross profit than LIFO as an accounting method. This happens typically because the prices of most commodities usually increase with time.

And that is a wrap. I hope you have a clearer understanding of COGS, the formula used for calculating it, and how to use the formula.

You can save all this time to calculate manually, though, if you are using online accounting software like Deskera. You can start your free trial and get ready-made COGS report along with all your financial statements and inventory reports.

Manage and know your inventory levels with Deskera within a few taps. Deskera’s inventory management software updates your stocks in real-time and allows you to view the stock availability in each warehouse in seconds.

Take charge of your inventory, now manage all your inventory through a single dashboard. Whether you're picking, packing, and shipping, or even dropshipping, we've got you covered.

Try Deskera Books Today
Sign Up For Free Trial

Key Takeaways

Here is a quick summary of what we covered in this article.

1) Why you need to know and track Cost of Goods Sold

2) What is Cost of Goods Sold

3) What is the Cost of Goods Sold formula

4) How to use the COGS formula with FIFO and LIFO

5) Example with numbers to show the use of COGS formula

You can read about COGS in great detail in this comprehensive guide on Cost of Goods Sold.

Quickly want to calculate COGS – here is a handy COGS calculator.

Hey! Try Deskera Now!

Everything to Run Your Business

Get Accounting, CRM & Payroll in one integrated package with Deskera All-in-One.

Great! Next, complete checkout for full access to Deskera Blog
Welcome back! You've successfully signed in
You've successfully subscribed to Deskera Blog
Success! Your account is fully activated, you now have access to all content
Success! Your billing info has been updated
Your billing was not updated