How do you calculate gross margin from a trial balance?
The short answer
Gross margin = (revenue − direct costs) ÷ revenue × 100, where direct costs are opening stock plus purchases and direct expenses, less closing stock.
The step people miss is the stock. A trial balance shows what you bought, not what you sold, so without the closing-stock adjustment the margin is wrong by however much stock moved in the month.
A trial balance shows what you bought, not what you sold
In an invented month, the same ledgers give a 40% margin with the stock adjustment and 35% without it. The five points are $6,000 of stock that was bought and not sold.
| US dollars | With stock adjusted | Purchases as cost |
|---|---|---|
| Revenue | 120,000 | 120,000 |
| Opening stock | 30,000 | — |
| Purchases | 70,000 | 70,000 |
| Direct expenses (freight in) | 8,000 | 8,000 |
| Less closing stock | (36,000) | — |
| Direct costs | 72,000 | 78,000 |
| Gross profit | 48,000 | 42,000 |
| Gross margin | 40% | 35% |
Every figure shown here is invented for illustration. Nothing on this page is computed from anyone’s accounts.
Which ledgers count as direct costs
Purchases of goods for resale or raw materials, freight inward and other direct expenses, and the change in inventory. Direct labour is treated either way, and a report should say which. Rent, salaries of administrative staff, marketing and depreciation are operating expenses: they come after gross profit, not before it. Put one in the wrong place and gross margin and operating costs are both wrong while profit stays the same, which is why nobody notices.
A month's margin needs a month's figures
Income and expense balances in a trial balance run from the start of the financial year. The month’s revenue and direct costs are this month’s closing balances less last month’s, except in the first month of the year. Gross margin on year-to-date balances is a year-to-date margin, which is a different figure.
Mapped once, computed every month
Magic MIS maps each ledger to a report head the first month and keeps the mapping, then computes gross profit as revenue less direct costs and gross margin as gross profit ÷ revenue × 100 for each month. Every figure opens to the ledgers behind it, so a misplaced ledger is visible rather than averaged in.
Read next
- KPIs and ratios for a monthly MIS: formulas and what they tell youThe ratios a monthly MIS or management accounts pack should carry — margins, debtor, creditor and inventory days, cash conversion cycle, current and quick ratio — with formulas.
- How is EBITDA calculated in an MIS report?Revenue less direct costs, employee costs and other operating expenses, with other income kept below it. A worked example from EBITDA down to profit before tax.
- Trial balance to management report: mapping ledgers to report headsHow a trial balance becomes a P&L and balance sheet summary: grouping ledgers into report heads, sign conventions, checks that the totals tie, and reusing the mapping monthly.
Get gross margin from your own trial balance
Create an account, load last month's trial balance, and get the report — paid per action.
Prepaid credits, no subscription. Credits never expire.