The Gross Margin Formula, and the Basket Your Ads Sell
Gross margin is revenue minus cost of goods, divided by revenue. The calculation and why the margin your ads sell can run eight points below your P and L.
A store's accounts show a 57.6 percent gross margin. The ad account runs at a ROAS of 1.90, which clears the 1.74 that margin demands by about nine percent. The month closes with $12,000 spent, $22,800 of tracked revenue and a loss of $660. Nothing was miscounted. The gross margin was correct. It described the wrong basket.
The gross margin formula is a subtraction and a division, and almost nobody gets the arithmetic wrong. What goes wrong is which revenue sits underneath it. This guide covers the calculation, the version of it that an advertiser needs, weighted by what the ads sell, and the date stamp on cost of goods that moves break-even ROAS before the monthly report shows it.
The formula, and the sum it hides
Gross profit is revenue minus cost of goods sold. Gross margin is that profit as a share of revenue. The gross profit calculator does both and adds the break-even ROAS the margin implies. By hand, using a month of sales from the three-product store in the opening:
Gross profit = Revenue − Cost of goods sold
Gross margin % = Gross profit / Revenue x 100
Break-even ROAS = 1 / Gross margin
Gross profit = $62,000 − $26,300 = $35,700
Gross margin = $35,700 / $62,000 = 57.6 percent
Break-even ROAS = 1 / 0.576 = 1.74
Search for the gross profit formula, gross profit margin or how to calculate gross margin and you land on the first two lines, which is where most pages stop. The third line is the one advertisers borrow. It is also the loosest ceiling available, because it ignores payment fees, fulfilment and returns. Spend above it loses money for certain. Spend below it can still lose, which is the subject of contribution margin vs gross margin. What counts as cost of goods in the first place is a separate question, and the COGS calculator handles it. Here the costs are taken as given.
One more trap before the main point. Gross margin is not markup. A product that sells at twice its cost has a 50 percent margin and a 100 percent markup, and mixing them up misprices the product in the direction that hurts. Margin vs markup sets the two side by side.
Now the part that matters. The $62,000 is a month of sales through every channel: ads, email, organic search, repeat customers, a few wholesale orders. A single percentage blends all of them by their share of revenue. That is right for the accounts. It is also a weighted average, and a weighted average only answers questions about its own weights.
Your ads sell a different basket
Ad platforms do not sell a catalogue evenly. A shopping or catalogue campaign pushes what converts and what already has budget behind it, which usually means the hero product, often the one with the sharpest price. Here are the three products, with unit counts for the whole month and for ad-attributed orders only.
| Product | Price | Cost of goods | Gross margin | Units, all sales | Units, from ads | Break-even ROAS |
|---|---|---|---|---|---|---|
| Cast-iron pan | $80 | $44.00 | 45% | 300 | 200 | 2.22 |
| Knife set | $120 | $54.00 | 55% | 150 | 40 | 1.82 |
| Silicone utensil set | $25 | $6.25 | 75% | 800 | 80 | 1.33 |
Price times units gives the two revenue totals, and cost of goods times units gives the two cost totals. The same arithmetic, run on two different baskets, gives two different businesses.
| Basis | Revenue | Cost of goods | Gross profit | Gross margin | Break-even ROAS |
|---|---|---|---|---|---|
| Whole store | $62,000 | $26,300 | $35,700 | 57.6% | 1.74 |
| Ad-attributed orders | $22,800 | $11,460 | $11,340 | 49.7% | 2.01 |
The pan is 39 percent of store revenue and 70 percent of ad revenue. The utensil set, the 75 percent margin product, is 32 percent of the store and under 9 percent of what the ads sold. Same prices, same costs, same month. The margin the ads sold is about eight points below the one on the P and L.
What a 1.90 ROAS does with each margin
Take the month from the opening. Spend was $12,000 against $22,800 of tracked revenue, a ROAS of 1.90. Test that against the store-wide margin and the account looks comfortable. $22,800 at 57.6 percent is $13,128 of gross profit, so spend is cleared by $1,128. Test it against the margin of what the ads sold and the same revenue produces $11,340 of gross profit. Subtract $12,000 and you are $660 short. The distance between the two answers is $1,788, and every dollar of it comes from the choice of weights.
That makes the target ROAS a property of the basket, not of the business. The pan needs 2.22 on its own, the knife set 1.82 and the utensil set 1.33. Per dollar of spend, a pan campaign running at 1.90 returns 85.5 cents of gross profit, while a utensil campaign at 1.60 returns $1.20. One account-wide target set from the P and L margin approves the first and shuts down the second. The revenue is whatever the platform attributes, so any over-crediting widens the gap and never narrows it. What is a good ROAS explains why the break-even figure comes before any benchmark.
Cost of goods has a date on it
The second drift is time. Cost of goods in the accounts is normally what you paid for the stock you sold, and some of that stock arrived months ago. Your next purchase order is priced today. Say the next batch of pans lands at $48.00 instead of $44.00, a rise of about nine percent from freight or a supplier change. The pan's margin falls from 45 percent to 40 percent and its break-even ROAS rises from 2.22 to 2.50.
Watch what that does to the two summary numbers. The whole-store margin moves from 57.6 to 55.6 percent, and break-even ROAS from 1.74 to 1.80. A shift that small gets put down to noise in a monthly report. The ad-weighted margin moves from 49.7 to 46.2 percent and break-even ROAS from 2.01 to 2.16, because pans carry 70 percent of ad revenue. At the same $12,000 and the same 1.90 ROAS, the month goes from a $660 loss to a $1,460 loss. The blended figure gave no warning because the pan is under 40 percent of the store. The ads found the exposure first.
What to do this week
Export the last 30 days of ad-attributed revenue by product from the shopping or product report in your ad platform. Next to each product, put its selling price and its current replacement cost, not the cost on the last invoice. Compute each gross margin, then weight those margins by the revenue the ads produced, not by store revenue. Divide 1 by the result and you have the break-even ROAS for the account. Repeat it per campaign group, since a target only means something at a level where the basket stays stable. The break-even ROAS calculator will check the division, and the ROAS calculator gives you the other side of the comparison.
The figures here are illustrative. They come from a worked example built so that every intermediate reproduces the printed result, not from a survey or from any one store. Margins differ by sector and by how you define cost of goods, so use your own. Break-even ROAS from gross margin is a floor for the target, not the target, because fees, fulfilment and returns sit below it.
Related reading: the AOV formula and POAS, profit on ad spend.