Profit Margin in Excel: Formulas for Profit, Margin and Markup
Calculate profit, profit margin and markup in Excel with clear formulas, the bracket mistake to avoid, and how to work out a selling price from a target margin.
By Ayoub Farid · · 1 min read
Profit, margin and markup are three different numbers, and mixing them up is expensive. Here's each one as an Excel formula. Sales (revenue) is in B, costs in C.
Profit
=B2-C2
Sales 5,800, costs 3,500 → profit 2,300.
Profit margin (profit as % of sales)
=(B2-C2)/B2
→ 39.7%. Format as %.
The brackets are essential. =B2-C2/B2 subtracts 0.6 from 5,800. See order of operations.
Markup (profit as % of cost)
=(B2-C2)/C2
→ 65.7%. Same profit, different base. Margin is usually what finance teams mean.
Selling price from a target margin
You want a 40% margin on an item that costs 60:
=C2/(1-40%) → 100
Check: (100 − 60) / 100 = 40%. A common mistake is =C2*1.4 (that's a 40% markup, giving only a 28.6% margin).
A full monthly table
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Month | Sales | Costs | Profit | Margin |
| 2 | Jan | 4,200 | 2,600 | =B2-C2 | =(B2-C2)/B2 |
Fill down. Then a yearly margin at the bottom: =SUM(D2:D13)/SUM(B2:B13). Don't average the monthly margins (see weighted average).
When sales are zero
=IF(B2=0,"",(B2-C2)/B2)
Avoids #DIV/0!. See #DIV/0! error.
Practise it
Profit formulas are in Cellio's "Profit & COUNT" lesson ("Mix cells and operators"), where you work with real sales and costs columns and get told when a bracket or reference is off.
Frequently asked questions
What is the formula for profit margin in Excel?
=(Sales-Costs)/Sales, formatted as a percentage.
What's the difference between margin and markup?
Margin divides profit by sales; markup divides profit by cost.
How do I calculate a price from a margin?
=Cost/(1-Margin).
How do I calculate total margin for the year?
Divide total profit by total sales, not the average of monthly margins.