Profit margin formula in Excel, after every fee
Short answer
Margin % = (price - total cost) / price. Markup % = (price - cost) / cost. To hit a target margin, price = total cost / (1 - target margin). For online sales, total cost must include the payment fee, the platform fee, the shipping you pay and packaging, not just the product cost.
Copy-paste code
Row 2: B price, C cost of goods, D fee %, E fixed fee, F shipping, G packaging
Fees: =B2*D2 + E2
Profit: =B2 - C2 - (B2*D2 + E2) - F2 - G2
Margin %: =Profit / B2
Markup %: =(B2 - C2) / C2
Price for 40% margin (fee % in D2, fixed costs in C2+E2+F2+G2):
=(C2 + E2 + F2 + G2) / (1 - 0.40 - D2)| Item | Amount |
|---|---|
| Price | $40.00 |
| Cost of goods | $15.00 |
| Card fee 2.9% + $0.30 | $1.46 |
| Marketplace fee 6.5% | $2.60 |
| Shipping you pay | $6.50 |
| Packaging | $0.80 |
| Profit | $13.64 (34% margin) |
Source: example numbers
Good to know
Margin and markup are not the same: a 50% markup is a 33% margin.
Marginmoor Seller Profit Tracker: See what you really keep from every sale
from $12Marginmoor is a seller profit tracker (Excel and Google Sheets) that shows fees, shipping and real margin per order. The free Profit Margin Calculator does a quick single check.
Secure checkout · 14-day fix-or-refund if it doesn't work as described (terms)Questions
What is a good margin?
It varies by industry; compare with your own fixed costs, not a rule of thumb.
Why divide by (1 - margin - fee %)?
Because percentage fees grow with the price, so they must come out of the denominator too.
Free: the Small Business Starter Kit
Bookkeeping and profit previews plus free invoice, rent receipt, margin and HACCP/allergen tools, then 5 short emails on margins, invoicing and checklists.