Contribution margin by product

The best seller keeps 8p in every pound.

The company and data are fictional.

Contribution margin is what a sale keeps after the costs it causes: (net sales − variable costs) ÷ net sales.

Net sales are sales minus refunds. Variable costs come with each sale: product, shipping and card fees.

Tom Hale founded Tarn & Tin, which makes drinkware and sells it online and to trade accounts. He's picking one product to promote next month. Which one?

June net sales, after refunds, against what each product kept, best seller first.
  • Insulated bottle£3,914£327
  • Cooler bag£3,735£1,720
  • Steel flask£1,984£1,016
  • Travel cup£1,782£1,101
  • Glass mug£988£450
  • Lunch box£840£562
  • Cotton tote£540£417
  • Straw set£372£292
  • Net sales
  • Contribution

Why the best seller is the wrong pick for now

June's sales report says promote the bottle, and nothing in it argues back. Ask three questions, though, and you get three winners.

June's shop sales, three ways.

QuestionWinnerFigureWhat it tells you
Highest net salesInsulated bottle£3,914What's popular
Highest marginStraw set78%What each pound keeps
Most contributionCooler bag£1,720What pays the bills

Tom blames refunds first: the bottle has 73% of the shop's refunds. So he removes them all. The margin reaches 30% and it's still last. The real cost is the bottle itself, which takes 66% of its sales.

How to calculate contribution margin by product

Tom builds a flow in Strata, Oplema's browser app for data prep, from three shop exports. Oplema's AI assistant, Elara, can help write the cost-sharing formula. Follow one order, ORD-5001, and its bottles.

  1. Keep shipped orders.

    Canceled orders earn nothing.

    Filter

    ORD-5001 shipped, so it stays.

    OrdersCount
    Shipped70
    Canceled2
  2. Attach order costs and unit cost.

    Each line gets its order's shipping and card fees, and its product's cost.

    Join

    ORD-5001, the bottle line.

    Shipping and fees on the orderCost of one bottle
    £16.90£25.00
  3. Share order costs by line sales.

    An order can have two lines, so each takes its share of the shipping and fees.

    Formula

    The bottle line takes most of ORD-5001.

    Line salesOrder salesShareCosts taken
    £380£42589%£15.11
  4. Total by product.

    Add up each product, then work out what it keeps.

    Summarize, Formula

    All Insulated bottle lines in June.

    Net salesCostsContributionMargin
    £3,914£3,587£3278%

What would make the bottle the right pick?

The flow ends in a Vista dashboard. Each setting changes the bottle only, at June's volume. Select each one and watch the red bar in Contribution by product.

Skip the interactive dashboard

Loading the interactive dashboard. The figures below don't depend on it.The interactive dashboard didn't load. The figures below don't depend on it.

These are scenarios. Nobody has changed a refund or a supplier yet.

SettingBottle contributionBottle marginEarns most
Today£3278%Cooler bag
Refunds halved£91620%Cooler bag
Refunds halved, unit cost 10% lower£1,25128%Cooler bag
Refunds halved, unit cost 25% lower£1,75339%Insulated bottle

Cutting refunds alone isn't enough. Even with refunds halved and cost 25% lower, it earns most but keeps the lowest margin.

Tom holds the bottle and runs three tests

Each row is a test still to run.

WhoDoes what, and why
BuyingTests a lower unit cost.
SupportReads the refund reasons, since one product has 73% of refunds.
MarketingTries Cooler bag as the lead, since it keeps 46% and already sells.

Now test your own best seller: take away its refunds. If it's still last, start with price and unit cost.

Who still owes for these sales? Priya's call list says who to chase first.

How we built it

Order lines

96 lines from your store.

Required columns: order_idproduct_idquantitysalesrefunds

Orders

72 orders, with shipping and card fees.

Required columns: order_idstatusshipping_costpayment_fees

Product costs

8 products, with unit costs.

Required columns: product_idproductunit_cost

See the steps run

Select the Formula block after the second Join: selling_cost is the share worked out above.

Skip the interactive flow

Loading the interactive flow. The steps above don't depend on it.The interactive flow didn't load. The steps above don't depend on it.

Left to right: the three exports, the shipped filter, two joins, the cost formula, the product total, then the metrics the dashboard reads.

The formulas in this flow

ColumnExpression
Selling cost(shipping_cost + payment_fees) * sales / sum(sales) OVER (PARTITION BY order_id)
Net salessales - refunds
Contributionround(net_sales - product_cost - selling_cost, 2)
Marginround(100.0 * (net_sales - product_cost - selling_cost) / net_sales, 2)
Refunds keptCASE WHEN product = 'Insulated bottle' AND params.fix >= 1 THEN round(refunds * 0.5, 2) ELSE 0 END
Unit cost savedCASE WHEN product = 'Insulated bottle' THEN round(product_cost * CASE params.fix WHEN 2 THEN 0.10 WHEN 3 THEN 0.25 ELSE 0 END, 2) ELSE 0 END

Choices and shortcuts

Margin is total over total. Averaging the product percentages gives 54% instead of 42%.

Sharing by line sales is a choice. Joining order costs straight onto lines charges an order's shipping once per line, and contribution falls to £5,558.

Refunded stock counts as lost, so a kept refund adds its full price. The settings hold volume and shipping as they were, and advertising and salaries aren't included. At the last setting the bottle's margin is 39%; the next lowest is 46%.

We left out 2 canceled orders worth £383. We wrote these patterns into the sample, so test the method on your own data.

Definitions

Net sales
Sales minus refunds, excluding VAT.
Contribution
Net sales minus product cost, shipping and card fees.
Margin
Total contribution divided by total net sales.
How it ties out
Net sales of £14,155 minus £8,271.51 of costs leaves £5,883.49.

FAQ

How do you calculate contribution margin?
Take net sales, subtract the costs that move with each sale, such as product cost, shipping and payment fees, then divide what is left by net sales. Across products, divide total by total.
What is the difference between contribution margin and gross margin?
Gross margin usually subtracts only the cost of the goods. Contribution margin also subtracts other costs that rise with each sale, such as shipping and fees, so it is often lower.
Should I drop a low-margin product?
Not from this alone. It may bring customers who buy other things, and that needs order history to test. Look at price, cost and refunds first.
How should I share order-level costs?
By line sales is the simple default. Weight or size can suit shipping better. The choice matters less than applying it the same way and stating it.

Build this ranking from your exports

Rerun it when June becomes July. Local runs are free.