Sub topic 8
Forecasting COGS and gross margin
This chapter assumes you can read an income statement, work with percentages, and run short Python scripts or build the same logic in spreadsheet formulas. It also assumes you have already built a revenue forecast from price, volume and growth. Cost of goods sold (COGS) depends on that revenue path, so the revenue forecast comes first.
What you are forecasting
COGS is the cost directly tied to producing what you sold: materials, direct labor, freight-in, production overhead, and sometimes depreciation of production equipment. Gross profit is revenue minus COGS. Gross margin is gross profit divided by revenue.
There are two ways to forecast COGS, and they answer different questions:
| Approach | You forecast | COGS is derived as | Best when |
|---|---|---|---|
| Margin-based (top-down) | Gross margin % per year | Revenue × (1 − margin) | The product mix is stable, or you need a quick forecast |
| Unit-cost-based (bottom-up) | Cost per unit, units, fixed production cost | Units × unit cost + fixed COGS | Price, volume and input costs move separately |
The margin-based method is short but hides the reasons margin changes. The unit-cost method makes each reason an explicit assumption, so you can defend it and test it.
Start from the historical baseline
Before choosing an assumption, compute the margin history. A forecast margin that ignores the trend needs an explicit reason.
revenue = {2022: 800.0, 2023: 900.0, 2024: 1000.0}
cogs = {2022: 480.0, 2023: 540.0, 2024: 590.0}
for year in revenue:
gross_profit = revenue[year] - cogs[year]
gross_margin = gross_profit / revenue[year]
print(year, round(gross_margin, 3))This prints 0.4, 0.4 and 0.41. Margin was flat for two years and then rose one point. Before you carry 41% forward, find out why it rose. A price increase, a cheaper supplier or a one-time inventory write-back would each justify a different forecast.
Check three things in the history:
- Whether COGS contains items that do not scale with revenue, such as plant depreciation or rent on a factory.
- Whether the company reclassified costs between COGS and operating expenses. A reclassification moves gross margin without changing operating profit.
- Whether one-off items (a write-down, a recall, a rebate) distort a single year.
The margin-based method
Set a gross margin for each forecast year, then derive COGS from revenue.
revenue = [1050.0, 1120.0, 1190.0]
gross_margin = [0.41, 0.415, 0.42]
for r, gm in zip(revenue, gross_margin):
cogs = r * (1 - gm)
gross_profit = r - cogs
print(round(cogs, 1), round(gross_profit, 1))The COGS values are 619.5, 655.2 and 690.2. Notice the assumption in the code: COGS moves in exact proportion to revenue, adjusted only by the margin you typed in. If revenue falls 20%, COGS falls about 20% too. That is wrong for any business with fixed production costs, because the margin should shrink when volume drops.
Use this method when:
- The company sells many products and a single blended margin is the practical unit of analysis.
- You are checking a more detailed model.
- Margin has been stable within a narrow band over several years.
Choose each year's margin from history, then adjust it for specific known changes. Avoid ending the forecast on a margin that is better than anything in the past with no stated cause.
The unit-cost method
Here COGS has two parts. Variable COGS is units sold times cost per unit. Fixed COGS is production overhead that stays roughly constant within a capacity range and steps up over time. The assumptions are the unit cost, its yearly inflation, and the growth of fixed COGS.
def forecast_cogs(years, units, price, unit_growth, price_growth,
unit_cost, cost_inflation, fixed_cogs, fixed_cogs_growth):
rows = []
for i, year in enumerate(years):
units *= 1 + unit_growth[i]
price *= 1 + price_growth[i]
unit_cost *= 1 + cost_inflation[i]
fixed_cogs *= 1 + fixed_cogs_growth
revenue = units * price
variable_cogs = units * unit_cost
cogs = variable_cogs + fixed_cogs
gross_profit = revenue - cogs
rows.append({
"year": year,
"revenue": revenue,
"cogs": cogs,
"gross_profit": gross_profit,
"gross_margin": gross_profit / revenue,
})
return rows
result = forecast_cogs(
years=[2025, 2026, 2027],
units=10_000,
price=50.0,
unit_growth=[0.10, 0.08, 0.06],
price_growth=[0.03, 0.03, 0.02],
unit_cost=22.0,
cost_inflation=[0.04, 0.04, 0.04],
fixed_cogs=60_000.0,
fixed_cogs_growth=0.03,
)
for row in result:
print(row["year"], round(row["revenue"]), round(row["cogs"]),
round(row["gross_margin"], 3))The margins come out near 0.447, 0.450 and 0.446. Three forces act on them:
- Price grows 3%, 3% and 2%, which lifts margin.
- Unit cost inflates 4% every year, which pulls margin down. Price growth slows in 2027 while cost inflation does not, so margin turns down in the last year.
- Fixed COGS grows 3% a year while units grow faster, so fixed cost per unit falls. This operating leverage lifts margin.
None of these effects appear if you type a margin directly. The model shows that the 2027 decline comes from price growth dropping below cost inflation. That is a result you can discuss with the people who set prices and negotiate with suppliers.
What moves gross margin
When you set or review a margin assumption, ask which of these drivers is changing:
- Price. A price rise with unchanged unit cost raises margin. With price 50 and unit cost 25, margin is 50%. At price 51 it is (51 − 25) / 51, about 51.0%.
- Input cost inflation. Materials, freight and labor rates that rise faster than price compress margin.
- Scale. Fixed COGS spread over more units lowers cost per unit. This works in reverse when volume falls.
- Mix. If the company sells a high-margin and a low-margin product, the blended margin changes whenever their shares change, even if each product's margin is constant.
- Efficiency and sourcing. Yield improvements, automation and supplier changes lower unit cost. Assume these only when a specific plan exists.
Mix is the easiest to overlook. Suppose product A has a 60% margin and product B has 30%. At a 50/50 revenue split, the blend is 45%. If B grows to 70% of revenue, the blend becomes 0.3 × 0.6 + 0.7 × 0.3 = 39%. A forecast that holds the blended margin at 45% while B outgrows A is internally inconsistent.
Margin versus markup
Gross margin is measured against revenue. Markup is measured against cost. Mixing them up produces large errors.
| Cost | Markup | Price | Gross margin |
|---|---|---|---|
| 60 | 50% | 90 | 33.3% |
| 60 | 66.7% | 100 | 40.0% |
| 60 | 100% | 120 | 50.0% |
A 50% markup does not give a 50% margin. When a source gives you a markup, convert it before using it: margin = markup / (1 + markup).
Gotchas and edge cases
COGS is not purchases. COGS is the cost of goods sold in the period, not the cost of goods bought. If inventory grows, purchases exceed COGS. For a simple forecast, treat the two as equal. If inventory levels change a lot, model beginning inventory plus purchases minus ending inventory, or the forecast will misstate COGS in the transition year.
Fixed costs are fixed only within a range. A factory with 80% utilization can absorb 10% growth without new overhead. At 100% it needs a new shift or a new line, and fixed COGS steps up. If your volume path crosses a capacity limit, add a step to the fixed COGS assumption instead of a smooth growth rate.
Inflation lags. Input costs often reach COGS months after the market price moves, because inventory is carried at older cost. A cost spike can hit margin in the following year. A cost drop can be delayed in the same way.
Services and software. For a service business, direct labor is the main COGS item, and it scales with headcount, not with revenue. Forecast utilization and billing rates, then derive labor cost. For software, hosting and support costs are variable, while capitalized development amortization can sit in COGS and behaves like a fixed cost.
Currency. If revenue is in one currency and materials in another, a single exchange rate move changes margin with no operational change. Separate the exposure or add it to your downside scenario.
Reconcile the two methods
If you build both, compare them. The unit-cost model gives an implied margin each year. If the top-down assumption was 42% and the bottom-up model says 44.6%, one of them contains an assumption the other lacks. Resolve the gap by finding it, not by averaging.
A useful check is to compute the implied margin for the last historical year using the unit-cost inputs. If the model cannot reproduce last year's actual margin from last year's price, units, unit cost and fixed COGS, it is not calibrated, and its forecast margin should not be trusted yet.
Review checklist
- Does forecast margin sit within the historical range, or is the move explained by a named driver?
- Is each cost line tagged as fixed, variable or semi-variable, and does it behave that way when volume changes?
- Do price growth and cost inflation make sense together? If both are high, check the economic story.
- Does fixed COGS per unit fall only when volume really grows?
- Are markup and margin kept apart?
- Does the same volume path feed both revenue and COGS?
Exercise
A product sold 20,000 units at a price of 40.00. Variable cost is 18.00 per unit and fixed COGS is 100,000. Next year units grow 10%, price is unchanged, unit cost inflates 5%, and fixed COGS is unchanged. Compute this year's and next year's gross margin. Which driver explains the change?
Show answer
This year: revenue is 20,000 × 40 = 800,000. COGS is 20,000 × 18 + 100,000 = 460,000. Gross profit is 340,000, so margin is 42.5%. Next year: units are 22,000, so revenue is 880,000. Unit cost is 18 × 1.05 = 18.90, so variable COGS is 22,000 × 18.90 = 415,800, and COGS is 515,800. Gross profit is 364,200, so margin is about 41.4%. Margin falls about 1.1 points. Cost inflation of 5% with no price increase reduces margin, and it outweighs the fixed-cost leverage from 10% volume growth.
Exercise
A supplier quotes a 25% markup on cost for a part. What gross margin does that give, and what markup would you need for a 40% gross margin?
Show answer
Margin = markup / (1 + markup) = 0.25 / 1.25 = 20%. For a 40% margin, rearrange to markup = margin / (1 − margin) = 0.40 / 0.60, which is about 66.7%.