The contribution margin formula is price minus variable cost. In Excel that is =Price-VariableCost per unit, =(Price-VariableCost)/Price for the contribution margin ratio, and contribution margin per unit times units sold for the total. In the free calculator below, an 8 oz candle sells for 24.00 with variable costs of 8.62, so each one contributes 15.38, a ratio of 64.1%, toward fixed costs and profit.
Free download
Contribution Margin Calculator (.xlsx, also opens in Google Sheets)
Working formulas, sample data and a How to use sheet. Opens in Excel, or import it into Google Sheets.
What contribution margin tells you
Every sale has costs that come with it: the materials in the product, the box it ships in, the card fee or the sales commission. What is left after those variable costs is the contribution margin. It is the money each sale contributes toward the costs that do not change with sales, like rent, salaries and software, and then toward profit.
Gross margin answers a different question. It subtracts cost of goods sold, which often mixes in some fixed production costs and leaves out selling costs like shipping and commission. Contribution margin splits costs by how they behave instead, which makes it the better number for pricing, product mix and “should we take this order” decisions.
The three contribution margin formulas
- Per unit: selling price per unit minus variable cost per unit.
- Ratio: contribution margin per unit divided by price. It is the share of each sales dollar left after variable costs.
- Total: contribution margin per unit times units sold, or total revenue minus total variable costs.
What is inside the free contribution margin calculator
The workbook has a How to use sheet and one Contribution Margin sheet with no macros. At the top you type the business name and the fixed costs for the month. A Summary box and four cards show the total contribution margin, the CM ratio, the fixed costs and the operating profit. Below that is a product table with room for 12 products and a contribution margin income statement.
The sample business is made up: Juniper Candle Co., a small candle maker with eight products and 34,500 in fixed costs a month.

To use it in Google Sheets, upload the file to Google Drive and open it with Google Sheets. Every formula works there too.
How to calculate contribution margin in Excel step by step
The product table starts in row 16. Column A holds the product, B the price, C the materials per unit, D packing and shipping per unit, E the sales commission as a percent of price and F the units sold this month. Columns G to M are formulas.
Step 1: Variable cost per unit
Add up every cost that goes up by the same amount with each unit sold. Commission is a percent of price, so multiply it by the price first. In G16:
=IF(A16="","",C16+D16+B16*E16)
For the 8 oz candle that is 4.10 for wax, wick and jar, 2.60 for packing and shipping, and 8% of 24.00, which is 1.92. The total is 8.62.
Step 2: Contribution margin per unit
In H16, subtract the variable cost from the price:
=IF(A16="","",B16-G16)
Each candle contributes 15.38. This is the amount you lose for every unit you do not sell and gain for every extra unit you do, as long as fixed costs stay the same.
Step 3: Contribution margin ratio
In I16, divide the contribution margin by the price and format the cell as a percentage:
=IF(A16="","",IFERROR(H16/B16,"Check"))
The candle’s ratio is 64.1%. A conditional formatting rule turns any ratio under 50% amber, so weak products stand out when you scan the column.

Step 4: Totals and share of contribution margin
Multiply by units sold to get the month’s totals. Total variable cost in J16, revenue in K16 and total contribution margin in L16:
=IF(A16="","",G16*F16)
=IF(A16="","",B16*F16)
=IF(A16="","",H16*F16)
Share of CM in M16 divides each product’s total by the business total in E7:
=IF(A16="","",IFERROR(L16/$E$7,0))
The 8 oz candle alone brings in 22.2% of the month’s contribution margin, 12,612 out of 56,729. That is the product to protect: a price cut or a jump in jar costs there hurts more than anywhere else.
Step 5: The weighted CM ratio
The business CM ratio is not the average of the product ratios. It is total contribution margin divided by total revenue, so products that sell more count more. In E8:
=IF(E6=0,0,E7/E6)
Juniper’s weighted ratio is 62.2%. If next month’s sales shift toward low ratio products, this number drops even when every price stays the same. The summary also names the product with the highest ratio, here the wax melts 6-pack at 66.4%, using INDEX and MATCH:
=IFERROR(INDEX($A$16:$A$27,MATCH(MAX($I$16:$I$27),$I$16:$I$27,0)),"")
Per unit or ratio: which one to look at
The two numbers can point in opposite directions. The gift set of 3 candles has a healthy 30.58 per unit, but the gift box and heavier shipping push its ratio down to 47.8%, the lowest in the range. The wholesale case contributes 73.30 per case, the most of any product, yet its ratio is only 55.5% because the case is sold at a wholesale price.
Use the ratio to compare products and spot ones where costs have crept up. Use the amount per unit when you decide whether an order or a promotion is worth it, because fixed costs are paid in money, not percentages. For a deeper look at the price side, the profit margin calculator in Excel shows how margin and markup differ, and the gross profit calculator in Excel covers the cost of goods view.
The contribution margin income statement
The block at the bottom of the sheet rearranges the month into a contribution format: revenue, minus variable costs, equals contribution margin, minus fixed costs, equals operating profit. Revenue in B31 links to the summary, variable costs in B32 add up column J, and the rest are subtractions:
=B31-B32
=B33-B34
For Juniper: 91,276 in revenue, 34,547 in variable costs, 56,729 of contribution margin, 34,500 of fixed costs and 22,229 of operating profit, or 24.4% of revenue. The Check cell confirms that this profit matches the summary and that the shares add up to 100%. A regular profit and loss template in Excel groups the same costs by type instead, which is what your accountant and lender expect to see.


Common mistakes
- Putting fixed costs in the variable columns. Rent spread per unit is not a variable cost. It does not go away when you sell one less.
- Forgetting selling costs. Shipping, packaging, card fees and commissions change with every sale. Leave them out and every ratio looks too good.
- Averaging the product ratios. The business ratio must be weighted by revenue: total CM divided by total revenue.
- Using last year’s costs. Material and shipping prices move. Update the variable costs when your suppliers change prices.
- Dropping a product on its ratio alone. A low ratio product can still bring in a lot of contribution margin in money.
Want more than the free file?
Profitability Analysis Pack in Excel
Go past one product table: a 12-month P&L, product and customer profitability, price-volume-mix, scenarios and sensitivity in 17 linked sheets.
Your next step: download the free contribution margin calculator, type in your own prices, variable costs and units, and see which products really pay for your fixed costs.
Frequently asked questions
What is the formula for contribution margin?
Contribution margin per unit is selling price minus variable cost per unit. The contribution margin ratio is that amount divided by price, and total contribution margin is the per unit amount times units sold.
How do I calculate contribution margin in Excel?
Put the price in one cell and the variable cost per unit in another, then use =Price-VariableCost for the margin per unit and =(Price-VariableCost)/Price for the ratio. Multiply by units sold for the total.
What is the difference between contribution margin and gross margin?
Gross margin subtracts cost of goods sold from revenue. Contribution margin subtracts every variable cost, including selling costs like shipping and commission, and leaves all fixed costs for later.
What is a good contribution margin ratio?
It depends on the industry and your fixed costs. What matters is that total contribution margin covers fixed costs with room to spare. Compare your products with each other and watch the trend month to month.
Does the contribution margin calculator work in Google Sheets?
Yes. Upload the free file to Google Drive and open it with Google Sheets. All the formulas and the conditional formatting carry over.
Free download
Contribution Margin Calculator (.xlsx, also opens in Google Sheets)
Working formulas, sample data and a How to use sheet. Opens in Excel, or import it into Google Sheets.

Want the finished version?
Monthly Budget Planner Template in Excel
Plan income and spending and compare budget against actual every month.
View the pro templateEducation only. Not financial, tax or investment advice.
