Profit margin formula in Excel or Google Sheets
Put the inputs in column B from row 2, then paste the formulas below. They work the same in Excel and Google Sheets.
| Cell | What | Value or formula | Example |
|---|---|---|---|
| B2 | Revenue ($) | 100000 | 100000 |
| B3 | Cost of goods sold ($) | 60000 | 60000 |
| B4 | Operating expenses ($) | 25000 | 25000 |
| B6 | Gross margin (%) | =ROUND((B2-B3)/B2*100,1) | 40 |
| B7 | Net margin (%) | =ROUND((B2-B3-B4)/B2*100,1) | 15 |
| B8 | Net profit ($) | =B2-B3-B4 | 15000 |
Get the ready-made spreadsheet
The same calculator as an .xlsx file, with the formulas set up. Free: enter your email and the download starts here right away. Your email also joins Clarivoxx Insights (a weekly article and a monthly newsletter; unsubscribe in one click).
Frequently asked questions
- How do you calculate profit margin?
- Subtract costs from revenue and divide by revenue. $100,000 revenue with $60,000 cost of goods is a 40% gross margin; after $25,000 of operating costs the net margin is 15%.
- What is the difference between margin and markup?
- Margin divides profit by the selling price; markup divides it by the cost. A product bought at $60 and sold at $100 has a 40% margin and a 66.7% markup.
- What is a good profit margin?
- It varies widely: software often has 70–80% gross margin, retail 25–50%. Compare with your own sector and watch the trend.
- How do you calculate profit margin in Excel?
- Put revenue in B2, cost of goods sold in B3 and operating expenses in B4. Gross margin % is =ROUND((B2-B3)/B2*100,1) and net margin % is =ROUND((B2-B3-B4)/B2*100,1). The free Excel template below has both set up.
- How much more do I need to sell after a discount?
- Extra volume needed = discount ÷ (gross margin − discount) × 100. At a 40% margin, a 10% discount needs 10 ÷ 30 = 33% more sales just to keep the same gross profit. If the discount is as large as the margin, no extra volume makes up for it.

About the author
Abdessamad Ghanem
Customer Experience & Customer Success Consultant · Founder of Clarivoxx
Abdessamad Ghanem works across Customer Support, Sales, Customer Success, Account Management and Partner Management. He writes Clarivoxx Insights for B2B SaaS professionals who own retention, adoption and customer outcomes.