← All how-to recipes

How to calculate profit margin (and not confuse it with markup)

✓ Verified in LibreOffice 25.8.7.3

Work out margin from cost and price — and keep margin and markup straight.

The formula

AppFormulaNotes
Excel=(B2-A2)/B2A2=cost, B2=price. MARGIN divides by price; markup is =(B2-A2)/A2 (divides by cost).
Google Sheets=(B2-A2)/B2Identical.
LibreOffice Calc=(B2-A2)/B2Identical.

How it works

Margin is profit as a share of the PRICE: ($80−$60)/$80 = 25%. Markup is the same profit as a share of the COST: $20/$60 = 33.3%. Same sale, different numbers — mixing them up is how products get underpriced. Going the other way: to hit a target margin m, price = cost/(1−m); a 25% margin on $60 cost means 60/0.75 = $80. Format the result as a percentage.

Verified, not just documented

We ran =(B2-A2)/B2 in LibreOffice 25.8.7.3 (headless, with forced recalculation) and it returned 0.25 — exactly the expected result. Every formula here is confirmed by actually executing it.