Sub topic 5
Gross profit: what is left after direct costs
This chapter assumes you can read the top of an income statement and know what revenue is. It also assumes you are comfortable with percentages. Gross profit is the first profit subtotal on the statement. It answers one question: after paying the direct cost of what we sold, how much is left to cover everything else?
The calculation
Gross profit is revenue minus cost of goods sold (COGS).
Gross profit = Revenue − Cost of goods soldRevenue here means net revenue. That is sales after returns, discounts, and allowances. COGS is the cost of the goods or services that produced that revenue, recognized in the same period.
For the running example in this tutorial, revenue is 1,000,000 and COGS is 600,000. Gross profit is therefore 400,000.
revenue = 1_000_000
cogs = 600_000
gross_profit = revenue - cogs
gross_margin = gross_profit / revenue
print(f"Gross profit: {gross_profit:>10,.0f}")
print(f"Gross margin: {gross_margin:>10.1%}")The gross margin is 40.0%. For each unit of currency of sales, 0.40 remains after direct costs.
What gross profit tells you
Gross profit measures the economics of a single sale before overhead. It does not include rent for head office, marketing, research, or interest. That makes it useful for three things:
- Pricing power. If a company can raise prices without raising unit costs, gross profit rises faster than revenue.
- Production or purchasing efficiency. Falling supplier costs or better factory yields widen the gap between revenue and COGS.
- Room to absorb overhead. Operating expenses must fit inside gross profit. If gross profit is 400,000 and operating expenses are 250,000, the business keeps 150,000. If operating expenses were 450,000, it would lose money however good the product looks.
How COGS is built for a merchandiser
A retailer or distributor usually does not track each item's cost as it is sold. It derives COGS from inventory balances:
COGS = Beginning inventory + Purchases − Ending inventoryInventory is only an expense once it is sold. Unsold stock stays on the balance sheet as an asset. This is the accrual principle from earlier in the tutorial applied to costs.
beginning_inventory = 120_000
purchases = 640_000
ending_inventory = 160_000
cogs = beginning_inventory + purchases - ending_inventory
print(f"COGS: {cogs:,.0f}")This prints 600,000, matching the example above. Note the side effect: if the company bought 640,000 of goods but ended the year with 40,000 more inventory than it started with, only 600,000 reaches the income statement.
Inventory cost methods change COGS
When unit prices change during the year, the company must choose which costs are assigned to units sold. Common methods:
| Method | Assumption | Effect when prices are rising |
|---|---|---|
| FIFO (first-in, first-out) | Oldest costs are sold first | Lower COGS, higher gross profit |
| LIFO (last-in, first-out) | Newest costs are sold first | Higher COGS, lower gross profit |
| Weighted average | Every unit carries the average cost | Between the two |
LIFO is allowed under US GAAP but not under IFRS. Two firms with identical operations can report different gross profit purely because of this choice. When comparing companies, check the accounting policy note.
What counts as a direct cost
The line between COGS and operating expenses is a judgment, and companies draw it differently. Typical items inside COGS:
- Raw materials and purchased goods
- Direct labor on the production line
- Factory overhead, such as plant utilities and depreciation of production equipment
- Inbound freight to bring goods to the warehouse
- For software and service firms, hosting costs, support staff, and delivery staff
Typical items outside COGS (in operating expenses):
- Sales commissions and advertising
- Head office salaries
- Research and development
- Outbound shipping to customers, at many companies (some include it in COGS)
Depreciation shows the problem clearly. Depreciation on a factory is in COGS. Depreciation on the head office is an operating expense. Some companies show gross profit excluding depreciation entirely, which flatters the figure.
Service businesses and missing gross profit
Not every income statement shows a gross profit line. Banks, insurers, and many professional-services firms present expenses by nature (salaries, rent, depreciation) rather than by function (cost of sales, selling, administrative). Under IFRS this "nature of expense" format is allowed, so there may be no COGS at all. In that case, do not invent a gross profit by guessing which costs are direct. Use operating income instead.
Gross profit by segment
A single blended gross margin can hide very different businesses. Suppose the 1,000,000 of revenue comes from two lines:
segments = {
"Hardware": {"revenue": 700_000, "cogs": 490_000},
"Subscriptions": {"revenue": 300_000, "cogs": 110_000},
}
total_revenue = sum(s["revenue"] for s in segments.values())
total_gross = 0
for name, s in segments.items():
gross = s["revenue"] - s["cogs"]
total_gross += gross
print(f"{name:<14} gross profit {gross:>9,.0f} margin {gross / s['revenue']:.1%}")
print(f"{'Total':<14} gross profit {total_gross:>9,.0f} margin {total_gross / total_revenue:.1%}")Hardware earns 30.0% and subscriptions earn 63.3%, which blend to 40.0%. If the mix shifts toward subscriptions, the overall margin rises even if neither line improves. This is called a mix effect. It is a common reason a company's gross margin moves, and it is worth separating from price and cost changes.
Common errors
- Confusing gross profit with gross margin. Gross profit is an amount (400,000). Gross margin is a percentage of revenue (40.0%).
- Using gross revenue. Returns and discounts must be removed first, or gross profit is overstated.
- Treating gross profit as cash. Revenue may not be collected yet, and COGS may have been paid for in an earlier period. Gross profit is an accrual measure.
- Ignoring inventory write-downs. When stock becomes obsolete, the loss usually goes through COGS and cuts gross profit in that period. It does not repeat in later years.
- Reading a rising margin as always good. A margin that rises because the company is under-recording COGS, such as capitalizing costs that should be expensed, is a red flag, covered in the quality-of-earnings chapter.
Exercise
A distributor reports net sales of 800,000. Beginning inventory was 90,000, purchases were 510,000, and ending inventory was 110,000. Calculate COGS, gross profit, and gross margin.
Show answer
COGS = 90,000 + 510,000 − 110,000 = 490,000. Gross profit = 800,000 − 490,000 = 310,000. Gross margin = 310,000 / 800,000 = 38.75%, or about 38.8%.
Exercise
Prices of a company's inputs have been rising all year. It switches from FIFO to LIFO. Without any change in operations, what happens to reported gross profit, and why?
Show answer
Gross profit falls. LIFO assigns the newest, higher costs to units sold, so COGS rises and revenue minus COGS shrinks. The company's real operations are unchanged, which is why you should check the inventory method when comparing gross margins across companies or years.