Last month your bicycle shop sold RM97,000. But you’d already paid for most of those bikes and parts. So how much of that RM97,000 was just paying back what the goods cost you?
Cost of goods sold (COGS) is what the goods you actually sold in a period cost you to buy or make. Not everything you bought: only what left the shop.
For this shop, the sum is short. RM42,000 of stock at the start of July + RM51,600 bought during the month − RM38,900 still on the shelf at the end = RM54,700. That’s its COGS for July.
You don’t need an accountant to work out COGS for your own month. You need an honest stock count and your supplier invoices.
Does this cost go into COGS?
Two questions decide it. Is the cost tied to the goods themselves, or to running the business? And did those goods sell this period?
| The cost | Into COGS? |
|---|---|
| What you paid the supplier for stock you sold this month | Yes |
| Delivery charges to bring that stock to you (lorry, courier in) | Yes, it’s part of what the stock cost |
| Stock you bought this month that’s still on the shelf | Not yet. It’s closing stock. It becomes COGS the month it sells |
| Ingredients used in the food you sold (F&B) | Yes |
| Shop rent, electricity, cashier or admin salary, advertising | No: running costs (operating expenses) |
| Delivering to your customer | Usually no: it normally stays in running costs. Agree it with your accountant |
| Stock you took home for yourself | No: that’s the owner taking stock out (drawings), not a business cost |
Kitchen wages, takeaway packaging and spoilt stock depend on your business. They’re covered in section 02.
01. What is cost of goods sold (COGS)?
Your accountant sends the draft accounts. There’s a line called “cost of sales” with a big number next to it. That line is almost always your COGS.
In plain words: it’s what the goods you sold cost you. If you bought a bicycle for RM600 and sold it for RM950, the RM600 is the cost of that sale. Add that up for everything you sold in the month and you have your COGS.
The key word is sold. A bike bought in July but not yet sold isn’t a July cost. It’s still stock (also called inventory) on your shelf.
In Malay, it’s kos jualan (or kos barang dijual). The English–Malay term list for the balance sheet and P&L maps the rest.
COGS is the number that tells you whether your prices work. Sales minus COGS is what’s left to pay rent, wages and yourself. If that gap is too small, no amount of selling fixes it.
02. What goes into COGS, and what doesn’t
Here’s the rule to remember: if you didn’t sell anything this month, would you still pay it? Then it’s a running cost, not COGS. Rent is due whether you sell ten bikes or none.
| Goes into COGS | Stays in running costs |
|---|---|
| Supplier price of the stock you sold | Shop rent |
| Delivery charges to bring stock in | Electricity, water, internet |
| Supplier discounts and returns (these reduce it) | Cashier, admin and sales salaries |
| Ingredients used in food you sold | Advertising and marketing |
| Raw materials used in goods you made and sold | Delivery to your customers (usually) |
| Bank charges, insurance, software | |
| Equipment: that’s an asset, spread over years. Ask your accountant how |
So is COGS an expense? Yes, but one that only appears when you sell.
- Kitchen or workshop wages. A cook who only makes the food you sell can be counted in cost of sales. Many small businesses keep all wages in salaries instead.
- Takeaway packaging. If every plate goes out in a box, some owners count the box as part of the dish. Others keep packaging as a running cost.
- Damaged, expired or missing stock. It usually ends up inside COGS anyway, because it’s not on the shelf at the count.
Which box you pick matters less than keeping it, so this month compares fairly with last month.
03. The COGS formula: opening stock + purchases − closing stock
You don’t need to track the cost of every item as it sells. The formula works it out from three numbers you already have.
COGS = Opening stock + Purchases − Closing stock
Here’s each part in plain words:
- Opening stock: what was on your shelf at the start of the month, at what you paid for it. It’s last month’s closing figure. How to work out opening stock.
- Purchases: everything you bought for stock during the month, from your supplier invoices. Add delivery charges to bring it in. Take off supplier returns and discounts.
- Closing stock: what’s still on the shelf at the end of the month, counted, and valued at cost. Not at your selling price.
Why take closing stock away? Opening stock plus purchases is everything you could have sold. Take away what’s still on the shelf, and what’s left is what you did sell, at cost.
For the bicycle shop in July:
- Opening stock: RM42,000
- Add purchases: RM42,000 + RM51,600 = RM93,600 of goods it could have sold
- Less closing stock: RM93,600 − RM38,900 = RM54,700 COGS
Working backwards: how to calculate purchases from COGS. If you know your COGS and both stock figures, flip it round: Purchases = COGS + closing stock − opening stock. For the shop: RM54,700 + RM38,900 − RM42,000 = RM51,600.
Your closing stock is more than you had plus what you bought. Check your closing stock count.
RM42,000 + RM51,600 − RM38,900 = RM54,700
Doing this once is easy. Rebuilding it every month is the tiring part. The sum isn’t hard. Getting the three numbers right is. Your purchases are spread across a pile of supplier invoices. Your sales are recorded somewhere else. Then you still have to work out what stock is left.
If your sales and purchases are already recorded in an accounting system, you don’t start from a blank spreadsheet every month. See how Niagawan Plus keeps your sales and purchases in one place →
04. COGS example: a Malaysian bicycle shop’s month, in ringgit
Kedai Basikal Laju Enterprise is an example business in Selangor, the same one used in our profit and loss statement guide. July 2026, all figures in RM.
| Cost of goods sold, July 2026 | RM |
|---|---|
| Opening stock (1 July) | 42,000 |
| Add: Purchases during the month | 51,600 |
| Less: Closing stock (31 July) | (38,900) |
| Cost of goods sold | 54,700 |
Now put it next to sales:
- Net sales: RM97,000 (bikes, parts and repairs, after returns and discounts)
- Less COGS: RM97,000 − RM54,700 = RM42,300 gross profit
- Gross margin: RM42,300 ÷ RM97,000 = 43.6%
For every RM100 this shop sold, about RM43.60 was left after paying for the goods. That RM43.60 has to cover rent, wages, bills and the owner.
Now look at what’s not in the RM54,700:
- Salaries, RM14,800. The staff are paid whether bikes sell or not.
- Shop rent, RM6,500. Same.
- Transport and delivery, RM980. In this example, that’s the shop delivering bikes to customers, so it stays in running costs. Delivery charges on stock coming in are already inside the RM51,600 purchases.
To see how running costs take RM42,300 down to the final profit, see where this sits in the full profit and loss statement.
RM8,750 of those sales is repair work, which uses few goods. Section 06 covers that.
05. COGS for a food business: cost per plate
If you run a stall, kopitiam or small restaurant, look at COGS two ways.
(a) Monthly: the same formula, with ingredients. Count what’s in the chiller and the dry store on the first and last day. Say an example stall starts the month with RM3,200 of rice, oil, chicken and spices, buys RM18,500 more, and ends with RM2,700 left:
RM3,200 + RM18,500 − RM2,700 = RM19,000
That RM19,000 is what the food served that month cost, including waste and spoilage.
(b) Per plate: does this menu price cover the ingredients? Take one dish, price every ingredient that goes on the plate, and divide by the selling price. Here’s an example nasi lemak ayam goreng sold at RM12.00:
| Ingredient (one plate) | Cost (RM) |
|---|---|
| Rice cooked in santan | 0.70 |
| Fried chicken, one piece | 2.60 |
| Sambal | 0.60 |
| Egg | 0.45 |
| Ikan bilis, peanuts, cucumber | 0.40 |
| Cooking oil and spices (share) | 0.25 |
| Ingredient cost per plate | 5.00 |
Step by step:
- Add the lines: RM0.70 + RM2.60 + RM0.60 + RM0.45 + RM0.40 + RM0.25 = RM5.00
- Food cost %: RM5.00 ÷ RM12.00 = 41.7%
- What’s left per plate: RM12.00 − RM5.00 = RM7.00 to pay for gas, staff, rent, packaging and you
The monthly figure tells you what really happened. The per-plate figure tells you which dishes are priced too thin: when chicken goes up by RM0.50 a piece, you’ll see it in the per-plate sheet the same day.
Keep them out of the per-plate sum unless you’ve agreed with your accountant to count them in, and treat them the same way every month.
06. Do service businesses have COGS?
If you sell your time and skills, not goods, you have little or no stock, so little or no COGS.
What you may have is cost of sales: the costs tied directly to doing the job. Parts you fit, materials you use up, a subcontractor you pay for that one job.
The bicycle shop’s repair work shows the split. Say RM1,900 of the parts that left the shelf in July were fitted during repairs:
| Repair work, July (example) | Where it goes |
|---|---|
| Parts fitted during repairs, RM1,900 | Cost of sales. Already inside the RM54,700, because it came off the same shelf and the stock count caught it |
| The mechanic’s time | Salaries (in the RM14,800), unless your accountant sets it up otherwise |
For a pure service business, such as a tuition centre or a consultant, the cost of sales line may be small or not there at all. Agree the split with your accountant once, then keep it.
07. Where COGS sits on your P&L, and how it changes your profit
On a profit and loss statement, COGS sits right under sales:
Sales − COGS = gross profit → minus running costs = net profit
So a wrong COGS makes every profit line below it wrong.
Here’s the part that confuses people. Stock is an asset while it sits on your shelf. It only becomes COGS, an expense, in the month it sells.
That’s why a big restock month doesn’t make you lose money, if you use the formula. Take an example: say the shop had also bought RM20,000 of extra bikes on 30 July, ready for a busy August, and sold none of them yet.
- Purchases become RM51,600 + RM20,000 = RM71,600
- Closing stock becomes RM38,900 + RM20,000 = RM58,900
- COGS: RM42,000 + RM71,600 − RM58,900 = RM54,700. Unchanged.
Now count all purchases as the cost instead: RM97,000 − RM71,600 = RM25,400 gross profit. That’s RM16,900 less than the real RM42,300, and it’s why July would look like a bad month when it wasn’t.
Any record that’s off does the same thing. A missing supplier invoice, a purchase in the wrong month or a guessed stock count gives you the wrong COGS. That gives you the wrong gross profit, and a wrong picture of how your business is doing.
This is why keeping sales, purchases and stock records together matters. If one part is missing or in the wrong month, your COGS, and your gross profit, can mislead you. See how Niagawan records sales and purchases →
COGS is an expense, so it sits on the debit side. At month end, the value of the goods sold moves out of stock (an asset) and into cost of sales. How that entry is set up in your books, and which account codes it uses, is your accountant’s call.
08. Why your COGS looks wrong, or suddenly jumped
A high COGS isn’t bad by itself. A COGS that grows faster than your sales is what to look at.
| What you see | What to check |
|---|---|
| A big restock month looks like a loss | You counted all purchases as COGS. Use opening + purchases − closing |
| COGS swings a lot from month to month | Closing stock was guessed, not counted. Count it on the last day |
| COGS looks far too low | Stock was valued at selling price, not cost. Revalue at what you paid |
| Gross profit looks better than your bank says | Delivery-in charges or some supplier invoices were left out of purchases |
| COGS a bit high, nothing else changed | Supplier returns or discounts weren’t taken off purchases |
| COGS keeps creeping up | Stock lost, spoilt or taken. It hides inside COGS, because it’s not on the shelf at the count |
| Margin slipped, sales steady | A supplier raised prices and your selling prices didn’t follow |
| Margin changed, prices didn’t | You sold more of your low-margin items this month |
If the count is the problem, the opening stock guide walks through counting and valuing stock at cost.
09. How to bring COGS down without cutting quality
Lowering COGS isn’t about buying cheaper rubbish. It’s about wasting less of what you pay for.
- ✅ Compare suppliers once or twice a year, just to know your price is still fair.
- ✅ Buy in sensible volumes. A bulk discount only helps if the stock sells before it spoils.
- ✅ Cut waste and shrinkage. For F&B, prep to your real daily sales, not your best day. Count regularly and chase gaps.
- ✅ Recheck prices when supplier costs move, and make sure every supplier credit comes off your purchases.
10. Working out COGS by hand every month, and when it stops working
Which way suits you depends mostly on how busy your business is:
- Very small or simple: a few products, a few supplier invoices a month. An invoice file and a stock count are still fine. Add up the invoices, count the shelf, apply the formula.
- More products, more transactions: Excel works. Put the three numbers in and let the sheet do the sum. But rebuilding the purchases and sales figures every month gets tedious. And the sheet is only as right as the count you type in.
- A busier business: sales and purchases every day. Here a system that records sales and purchases as they happen becomes more practical. You still count your stock. You stop re-adding everything around it.
The manual way usually slips in two places: the stock count gets rushed once the shop is busy, and supplier invoices land in the wrong month. If that sounds like your month end, section 11 shows the other way.
11. Seeing your COGS and gross profit without rebuilding them each month
Want to stop rebuilding COGS by hand every month?
With Niagawan, your sales and purchases are already part of your accounting records. Once your stock count is kept up, your P&L with COGS and gross profit is a report you open, not a spreadsheet you rebuild.
The parts that matter for COGS:
- Sales and expense records in one place, with sales and expense analytics
- Purchases recorded from your supplier invoices, in the same system
- Financial reports, including your profit and loss
Niagawan Plus, RM497 / year (3 user IDs). Also covers receivables and payables aging, digital invoicing and bank reconciliation. See Niagawan Plus →
PosPro, RM797 / year (4 user IDs). POS and accounting together for shops and food businesses that sell at a counter: barcode scanning, shift tracking, offline mode and SST support. See PosPro →
Prices exclude SST.
Rather see it before you decide? Ask our team for a product demo on WhatsApp →
Frequently asked questions
Is COGS an expense or an asset?
Both, at different times. Stock is an asset while it’s on your shelf. It becomes COGS, an expense, in the month it sells.
Is cost of sales the same as COGS?
For a shop or food business, yes: many Malaysian accounts call the COGS line “cost of sales”. For a service business, cost of sales can also include direct job costs like parts fitted or subcontractors.
Does COGS include salaries?
Usually not. Cashier, admin and sales staff are running costs. Wages for people who only make the goods you sell, such as a cook, can be counted in cost of sales; agree it with your accountant and keep it the same every month.
Is packaging part of COGS?
It depends. Packaging that goes out with every item you sell is often counted in, but many small businesses keep it as a running cost. Pick one with your accountant and stay consistent.
Does COGS include delivery charges?
Delivery to bring stock to you is part of what the stock cost, so it’s in. Delivery to your customers usually stays in running costs.
How do I calculate COGS in Excel?
Type opening stock in cell B1, purchases in B2 and closing stock in B3. In B4, type =B1+B2-B3. That’s your COGS.
Can I work out COGS without counting closing stock?
Not accurately. Some owners estimate it from their usual gross margin for a month, but label that figure an estimate and count properly at least at year-end.
FIFO or average cost: which do I use?
FIFO assumes the stock you bought first is sold first. Average cost uses the average price you paid. Agree the method with your accountant and keep using it.
What is a good COGS percentage?
There’s no single good number. It depends on what you sell. Compare your own COGS as a percentage of sales month to month, and check it against your own prices.
