Cost of goods sold (COGS) is the cost of the stock you actually sold or used during a period: for a restaurant, the food, drinks and packaging that went out to guests; for a shop, the purchase cost of the products that left the shelves. The formula is: COGS = opening inventory + purchases − closing inventory. Divide it by net sales and you get COGS %, the share of every riyal of sales that went on the goods themselves. It is the first cost on your income statement, and the number that decides your gross profit.
Most explanations of COGS are written for accounting students. This one is for owners, operations managers and finance managers of multi-branch businesses, who need the number to be right, comparable across branches and ready every month.
The COGS formula, step by step
- Opening inventory: the value of stock on hand at the start of the period, which is last period's closing count carried forward.
- Purchases: everything bought during the period, at invoice cost excluding VAT, net of supplier returns, credit notes and rebates.
- Closing inventory: the value of stock still on hand at the end of the period, from a physical count.
- Transfers, for multi-branch businesses: add stock received from other branches or a central kitchen, and subtract stock sent out. Without this, one branch looks cheap and another expensive for goods that simply moved.
So the full branch-level version is: COGS = opening inventory + purchases + transfers in − transfers out − closing inventory. The logic is simple: whatever came in and is no longer on the shelf was either sold or used.
What goes into COGS, and what stays out
For a restaurant
COGS covers the direct cost of what you serve: food ingredients, beverages, and the packaging that leaves with the order, such as takeaway containers, cups and bags. Some operators track packaging as a separate line; either choice works as long as every branch makes the same one.
Rent, salaries, utilities, marketing and delivery-app commissions are not COGS. They are operating expenses, and they sit below gross profit on the income statement. Labour still belongs in the same conversation: prime cost is COGS plus labour cost, the two largest costs a restaurant can change from week to week.
For a shop
COGS is the landed cost of the products sold: the supplier price, plus inbound freight, customs duties and any other cost of getting the goods into a sellable state, less supplier discounts and rebates. Store staff, rent, shop fit-out and advertising stay out.
“A simple test: if a cost rises and falls with every unit you sell, it probably belongs in COGS. If you pay it whether you sell ten items or ten thousand, it belongs below gross profit.”
A worked example for one branch
The numbers below are illustrative only, for one restaurant branch over one month, all excluding VAT:
- Opening inventory (last month's count): SAR 48,000
- Purchases from suppliers: SAR 118,000
- Transfers in from the central kitchen: SAR 9,000
- Transfers out to another branch: SAR 2,000
- Closing inventory (this month's count): SAR 43,000
- Net sales for the month: SAR 400,000
COGS = 48,000 + 118,000 + 9,000 − 2,000 − 43,000 = SAR 130,000. COGS % = 130,000 ÷ 400,000 × 100 = 32.5%. Gross profit = 400,000 − 130,000 = SAR 270,000, a gross margin of 67.5%.
Now suppose the closing count was wrong: SAR 48,000 recorded instead of 43,000. COGS drops to SAR 125,000, or 31.25%, and the branch looks better than it is. Next month that inflated figure becomes opening inventory, and the same SAR 5,000 lands on next month's COGS. A counting error never disappears; it moves into the following month. That is why a branch whose COGS % swings up and down usually has a counting problem, not a kitchen problem.
COGS %: what the number tells you
COGS % = COGS ÷ net sales × 100. It tells you how much of each riyal of sales goes on the goods themselves, and therefore how much is left to pay for staff, rent and everything else, and still make a profit.
There is no single correct figure. Target ranges quoted online are rough rules of thumb at best, because a coffee shop, a burger chain, a fine-dining restaurant and an electronics retailer have completely different cost structures. Compare against your own history, your budget and other branches of the same concept: a branch whose COGS % rises two points while its menu and prices stayed the same is telling you something.
Read the percentage together with the riyal amount. COGS % can fall simply because you raised prices, while the quantity used in each dish quietly went up.
COGS vs cost of sales vs gross profit
Cost of goods sold and cost of sales are often used to mean the same thing, and for most restaurants and shops the two figures are close. Where they differ, cost of sales is the wider term: depending on the company's accounting policy, it can include other direct costs of delivering the sale, such as direct labour in some service businesses, alongside the goods themselves. COGS is strictly the cost of the stock sold. Agree with your accountant which definition your business uses, write it down, and apply it to every branch.
Gross profit is what is left after COGS: net sales − COGS. Gross margin is the same figure as a percentage of net sales. COGS % and gross margin always add up to 100%, so in the example above a COGS of 32.5% means a gross margin of 67.5%.
Where COGS sits in the income statement
- Net sales (revenue)
- Less: cost of goods sold (or cost of sales)
- = Gross profit
- Less: operating expenses (salaries, rent, utilities, marketing, delivery commissions)
- = Operating profit, then finance costs and zakat or tax, down to net profit
Why COGS differs between branches
When two branches of the same concept show different COGS %, the cause is usually on this list. Check the data causes first; they are the most common and the cheapest to fix.
- Counting errors: a storage area missed, the wrong unit (cases counted as pieces), or stock counted on a different date from the period end.
- Transfers between branches: stock sent between branches, or from the central kitchen, recorded on one side only, so the sender looks cheap and the receiver expensive.
- Waste: spoiled or discarded stock that is never logged. It still shows up in COGS, but nobody can explain it.
- Theft and unrecorded loss: stock that leaves without a sale. Rule out the other causes first, because most suspected theft turns out to be counting or receiving errors.
- Price changes: one branch buying the same item at a higher price, or stock valued at different unit costs in different branches.
- Menu or product mix: a branch selling more of the higher-cost items. Nothing is broken; the mix is different, and the response is pricing or menu engineering.
If the data is clean and the gap remains, compare actual cost with the theoretical cost your recipes imply. Our guide to why restaurant food cost runs high covers that method in detail.
Periodic vs perpetual inventory, in plain words
With a periodic inventory system, you count stock at the end of each period and work COGS out with the formula. It is simple and needs no extra software, but you only learn the number once the period is closed, and it cannot tell you where a gap came from.
With a perpetual inventory system, every sale, delivery, transfer and waste entry is posted to a running stock balance, using recipes or item costs. The physical count then checks the system instead of being the only source of the number, and the gap between expected and counted stock is your variance, the most useful number in the whole exercise.
Most multi-branch operators use a mix: perpetual records for high-value items, and a full count of everything at month end. In practice, two tools sit behind a COGS figure you can trust: a disciplined stock count, and a food-cost calculator that turns each recipe into a cost per dish.
Doing it every month across many branches, without spreadsheets
Calculating COGS for one branch is easy. Doing it for twenty branches, every month, in a way you can compare, is where it breaks. Most of the fixes are agreements, not software:
- One count date and cut-off time for every branch, so every closing inventory describes the same moment.
- One valuation method, such as weighted average cost, and the same unit costs in every branch.
- Transfers recorded on both sides, at the same value, before the period closes.
- One mapping of items to categories, so food, beverages and packaging mean the same thing everywhere.
- Purchases and sales both excluding VAT, on the same business-day boundaries.
Even then, pulling counts, invoices, transfers and sales from every branch into one spreadsheet takes days, and the result is out of date by the time it is shared. That is the step worth automating.
How DataGrid helps
DataGrid brings sales, purchases, transfers and stock counts from every branch into one place, with no data team. COGS is calculated once, with one agreed definition, so every branch and every meeting sees the same number. Ready-made dashboards show COGS, COGS % and gross margin by branch, updated automatically every day, and the AI Advisor explains what changed, why it changed and what to do next: which items drove a branch's rise, and whether the cause looks like a count, a transfer or a price. Book a demo to see COGS for your own branches.
Frequently asked questions
Are salaries part of cost of goods sold?
No. Salaries and wages are operating expenses, not COGS, in both restaurants and shops. Some companies include direct labour in a wider cost of sales line, which is why the definition needs to be agreed. Restaurants usually watch labour alongside COGS as prime cost: COGS plus labour cost, as a share of net sales.
How often should I calculate COGS?
At least monthly, with a full stock count, because that is when you close the books. Many multi-branch operators also track it weekly for their highest-value categories, with a partial count of the items that drive most of the cost, so a problem shows up while the month is still open.
What is the difference between COGS and food cost?
Food cost is the part of COGS that relates to food. COGS covers everything you sold: food, beverages and, in most restaurants, packaging. Food cost % is food COGS divided by food sales, and beverage cost % works the same way for drinks. Track them separately, because they behave differently and different people fix them.