Blog / Stock tracking

Stock tracking

How to Calculate Cost of Goods Sold (COGS) for a Small Business

An illustration showing opening stock plus purchases minus closing stock = cogs

Ask ten shopkeepers what their business made last month and most will answer with what came in through the till. It's a natural thing to do, and it's the wrong number. The till tells you what you took. It doesn't tell you what the goods you sold cost you.

That second number is called the cost of goods sold, or COGS. Once you know it, you can see your real profit.

What COGS is, and what it isn't

An illustration showing COGS of a mug that costs KES 250 and sold for KES 400, with a profit of KES 150

Cost of goods sold is what the items you sold cost you to buy and get to your shop. If you sold a mug for KES 400 that cost you KES 250, the COGS for that sale is KES 250. The other KES 150 is your gross profit.

It isn't everything you spent. Rent, wages, electricity and advertising are real costs, but they're not part of COGS (you get where this is going). COGS is only the cost of the stock that left your shelves as sales.

The formula

An illustration showing COGS formula for a retail shop: opeing stock + purchases - closing stock

You don't need to track the cost of every single sale. For most small shops, there's an easier way, using three numbers you can get from a count and a few records:

COGS = opening stock + purchases − closing stock

Think of it as a story. You started the period with some stock (opening stock), you bought more along the way (purchases), and at the end, some is still on the shelves (closing stock). Everything else must have been sold, right? Right? Maybe not quite, but we will get to that shortly.

Take a small stall for a month. It started with KES 25,000 of stock, bought KES 30,000 more, and ended with KES 28,000. That's 25,000 + 30,000 − 28,000 = KES 27,000. Sell that stock for KES 36,000 and the gross profit is KES 9,000.

All three numbers are at cost, meaning what you paid.

A worked example

An illustration showing COGS calculation for a shop with an opening stock of 120,000, purchases worth 300,000, delivery charges of 10,000, returns to supplier of 5,000 and a closing stock of 14,000

Here is a bigger shop for one month. It paid KES 10,000 to have its purchases delivered and returned KES 5,000 worth of goods to its suppliers.

KES
Opening stock120,000
Purchases300,000
Delivery charges on purchases10,000
Goods returned to suppliers−5,000
Closing stock−140,000
Cost of goods sold285,000

Notice that the KES 10,000 delivery charge is included because it was spent getting the goods to your shop. Delivery to customers is different; that's a selling expense.

Start with the stock you had, add what you bought and the cost of getting it to the shop, then subtract supplier returns and the stock left at the end. That gives you KES 285,000.

Now bring in the sales. If the shop sold KES 400,000 that month (before VAT), then:

So for every KES 100 it sold, the goods cost it about KES 71 and left about KES 29 to pay for everything else.

Why purchases are not COGS

The most common mistake is to treat what you bought as what you sold. They're the same only if your stock never changes at the end of a given period, meaning sales and restocking balanced out. And COGS considers only goods that you sold.

In simpler terms, what did it cost you to acquire all the goods that you sold? Two parts: first acquire, then sell. Now you get why we must subtract the closing stock from the sum of starting stock and purchases.

In the example above, the shop bought KES 300,000 of stock. But it also finished the month with KES 20,000 more on its shelves than it started with. That extra stock hasn't been sold yet, so it can't count as a cost of selling. The cost of what went out is smaller than what came in.

If stock goes down instead, the opposite happens. Sell more than you buy, and COGS comes out higher than your purchases.

What goes in and what stays out

An illustration showing what constitutes COGS including purchase price of goods, freight, import duties and less returns, versus what does not, including rent, wages, electricity costs, advertising, and delivery to customers.
In COGS
  • The purchase price of the goods, after discounts
  • Delivery, freight, and handling charges for getting the goods to you
  • Import duties, if you import
  • Less any returns to suppliers
Not in COGS
  • Rent, wages, electricity, advertising
  • Delivery to your customers
  • Payment and bank fees
  • Repairs and equipment

Notice the differences between delivery costs to you and to your customer? The first one, freight, is part of what it costs you to acquire the goods, hence included in COGS. The second one, however, is part of operational costs, which must be covered by your profits.

Another important note is on VAT. If you're VAT-registered and eligible to claim input VAT on your purchases, exclude that recoverable VAT from the cost. If you can't reclaim it, the VAT forms part of your cost. Keep your sales figures and stock costs on a consistent VAT basis. If you're unsure, check with an accountant.

What gross profit tells you

Once you have COGS, you can work out gross profit (sales minus COGS) and gross margin (gross profit as a share of sales). It's the first test of whether your pricing and buying are working.

It's different from the margin on a single item, which we covered in margin and markup. That's about one product's price. Gross margin is for the whole shop, averaged over everything you sold, including the discounts, the bargains and the mistakes.

The catch: stock losses can hide inside COGS

Now let's get to this important point, right?

The formula counts every bit of stock that left the shelves as "sold", whether or not a customer paid for it.

Stock that was stolen, spoiled, damaged or given away is gone from your shelves. Unless you've recorded those movements separately, they'll all find their way into the calculation.

An illustration showing other stock losses included in COGS calculation, including theft, damage, spoilage and giveaways.

Go back to the example. The calculation gives you COGS of KES 285,000. But suppose your sales records show that customers actually bought goods that cost KES 280,000. There's a KES 5,000 difference.

This matters because the figure from the stock calculation can make your gross margin look lower than the margin on the goods customers actually bought. In this example, stock acquired for KES 280,000 would give a gross margin of 30%, compared with 28.75% when you use the full KES 285,000. Remember the denominator is the same (gross profit of KES 400,000 in this case).

If your stock costs are rising as a share of sales and you haven't changed your prices or suppliers, it's worth checking for losses and recording errors. Our guides to shrinkage and doing a stocktake show you how.

Mistakes to avoid

Valuing closing stock at selling prices. It must be at cost, or your COGS will be too low.

Starting with the wrong opening stock. This period's opening stock is last period's closing stock, exactly. Copy it across.

Leaving out delivery costs. If you pay to get goods to your shop, they're part of what the goods cost you.

Putting expenses in. Rent, wages, and delivery to customers belong further down the profit statement. Mixing them in makes your gross margin unreadable.

Using an estimate for closing stock. An actual count is better, and it's the weakest link in the whole sum.

How often

Working it out once a month is a good starting point for most small shops. Pick the same day each time, count your stock, and work out your COGS from that count. Even once a quarter is a big step up from never.

The first month is the hardest because you also have to count your opening stock. After that, each closing count becomes the next month's opening count.

Letting the tools help

Counting and adding up a list by hand is where errors creep in. Our free stock value calculator values your closing stock at cost. Then our inventory turnover calculator can work out your cost of goods sold from your opening stock, closing stock and purchases. Enter your purchases after returns and including delivery, and it does the sum. It also shows how many days your stock sits before it sells.

If you want to understand the stock value behind the sum, here is how to work it out.

Work out your cost of goods soldEnter your opening stock, purchases and closing stock, and see your days in stock too. Free, private, no sign-up.
Try the calculator

Final thoughts

COGS can sound like accounting jargon, but it's three numbers and a subtraction. And it changes the question you ask about your shop from "how much did I take?" to "how much did I keep after paying for what I sold?"

Do it once for last month. Count the stock, find your purchases, and subtract. If the answer surprises you, you've learned something the till could never have told you.

Key takeaways

  • COGS is what the stock you sold cost you. It is not rent, wages or other expenses.
  • COGS = opening stock + purchases − closing stock, all at cost.
  • Purchases are not COGS unless your stock didn't change.
  • Gross profit = sales − COGS. Gross margin = gross profit ÷ sales.
  • The formula counts lost stock as sold, so a rising COGS share can point to shrinkage.
The Easy Ventory team

We build a free, private, offline inventory app for small businesses.

Know your stock, protect your privacy

Easy Ventory works offline, needs no account, and keeps your data on your phone.

Get Easy Ventory