Calculate Profit Margin From Revenue and Cost
You know what each product costs and what it sells for, and you need the margin — what share of each sale is profit — to compare products or check pricing.
Excel & Google Sheets
This formula works in both Excel and Google Sheets.
How it works
With cost in column A and revenue in column B, revenue minus cost is your profit, and dividing by revenue turns it into a margin — the fraction of each sale you keep. Format the cell as a percentage: a $200 sale with a $120 cost shows 40%, meaning 40 cents of every dollar is profit. The denominator is what makes it a margin: dividing by revenue answers "what share of the sale is profit," while dividing by cost answers a different question (markup). Margin can never exceed 100%, so if you see 150%, you've computed markup by mistake.
When to use it
Use margin to compare profitability across products, quote jobs, set pricing floors, or track gross margin month over month. It's the number investors and lenders expect when they ask about profitability.
Common mistakes
Did this formula help?
Engine-verified against the sample data aboveLast reviewed 2026-07-08