The Excel formula for profit margin is =(B2-C2)/B2, where B2 is the selling price (or revenue) and C2 is the cost. Format the cell as a percentage and you are done: a $40 product that costs you $26 shows 35%. This guide gives you the gross and net versions, a worked example you can copy row by row, the difference between margin and markup that trips up most sheets, and what to check before you pay for a ready profit calculator instead of building one.
The two formulas you actually need
Margin is profit divided by the selling price. It answers one question: out of every dollar a customer pays, how much do you keep? There are two common versions.
- Gross margin counts only the direct cost of the thing you sold: what you paid for it, or what it cost to make. Formula:
=(B2-C2)/B2. - Net margin subtracts everything: platform fees, payment fees, ads, refunds, software, shipping if you have any. Formula:
=(B2-C2-D2-E2)/B2, with one column per cost type, or=(B2-SUM(C2:G2))/B2when the costs sit next to each other.
Set up a simple sheet like this:
| Column | What goes in | Example |
|---|---|---|
| A | Product name | Desk lamp |
| B | Selling price | 40 |
| C | Cost of goods | 26 |
| D | Profit: =B2-C2 | 14 |
| E | Margin: =D2/B2 | 35% |
| F | Markup: =D2/C2 | 53.8% |
Type the formulas once in row 2, then drag the fill handle down. Every row gets its own margin. To format column E as a percentage, select it and press Ctrl+Shift+% or use Home, Number, Percent Style. Add one decimal place with the "Increase Decimal" button if you want 35.0% instead of 35%.
A worked example, step by step
Take the row above. You sell a lamp for $40 and it costs you $26.
- Profit: 40 minus 26 is $14.
- Margin: 14 divided by 40 is 0.35, so 35%.
- Markup: 14 divided by 26 is 0.538, so 53.8%.
Same $14, two very different percentages. That is the whole margin versus markup problem in one row.
Now the reverse question, the one you ask when you set prices: what price gives you a 40% margin on a $26 cost? The formula is =C2/(1-G2), where G2 holds the target margin as 40%. The answer is 26 / 0.6 = $43.33. Check it: 43.33 minus 26 is 17.33, and 17.33 / 43.33 is 40%. A common mistake is to calculate 26 × 1.4 = $36.40 and call it a 40% margin. That is a 40% markup, and the margin on it is only 28.6%.
Margin versus markup
Margin divides profit by price. Markup divides profit by cost. Margin can never reach 100%, because that would mean the item cost nothing. Markup has no ceiling. If your sheet shows a margin of 150%, you divided by cost.
| Markup on cost | Margin on price |
|---|---|
| 25% | 20% |
| 33.3% | 25% |
| 50% | 33.3% |
| 66.7% | 40% |
| 100% | 50% |
| 200% | 66.7% |
To convert in Excel: margin from markup is =M2/(1+M2), markup from margin is =G2/(1-G2). Put a note on top of the column that says which one it is. Half the arguments about "our margin" in small businesses come from two people reading one number two ways.
Net margin for people who sell digital products
Digital products have almost no cost of goods, so gross margin looks close to 100% and tells you nothing. The real costs are fees and refunds. Give each one its own column, so you see where money goes.
- Platform fee. Usually a percentage. On Getly, for example, the platform take starts at 20%, and sellers keep 80–90% depending on monthly volume and whether the sale came from their own link. Formula:
=B2*H2, with H2 as the fee rate. - Fixed per-order fees. Card processing often has a fixed part. Getly never takes less than its processing cost plus 2%, and on card orders that cost is 2.9% + $0.30 per order. So on very small card sales, under about $6, the fixed 30 cents matters. Model it as
=B2*I2+J2: a rate plus a fixed amount. - Ads. Divide the month's ad spend by the units sold that month to get cost per sale.
- Refunds. Use a refund rate column. Expected refund cost per sale is
=B2*K2.
A small example. You sell a template for $12. A 20% platform take is $2.40. Your ads cost $2 per sale. Profit is 12 minus 2.40 minus 2, so $7.60, and the net margin is 7.60 / 12 = 63.3%. That number, not the 100% gross margin, is the one to compare month to month.
Errors that break a margin sheet
- #DIV/0! on empty rows. A row with no price divides by zero. Wrap the formula:
=IFERROR((B2-C2)/B2,""), or be explicit with=IF(B2=0,"",(B2-C2)/B2). The IF version is safer, because IFERROR also hides typos you want to see. - Dividing by cost. If you see margins above 100%, you built a markup column.
- Percent typed as a whole number. Typing 40 into a cell formatted as a number and using it as a rate gives 4000%. Type 40% or 0.4.
- Averaging percentages. The average margin across products is not the margin of the business. Use total profit divided by total revenue:
=SUM(D2:D50)/SUM(B2:B50). - Prices with tax inside. If your price includes VAT or sales tax, take the tax out first. Otherwise every margin looks a few points better than it is.
- Mixed currencies. Costs in one currency and prices in another need a rate column, or the margin is fiction.
When a ready calculator is worth buying
The formulas above fit in five minutes. A ready calculator earns its price when it does the boring parts for you: fee tables per sales channel, a pricing tab that works backwards from a target margin, monthly totals, charts, and protected formula cells so nobody types over them. On Getly these sit in Spreadsheets & Calculators and Excel Templates.
What the shelf costs, measured on 17 November 2026: the two categories together hold 333 listings. The middle half is priced between $7 and $12.99, with a median of $12. Only 2.4% are free. The narrower part, the 37 listings with "profit" or "margin" in the name, costs a little more: a median of $12.99, the middle half between $9 and $19, and none of them free. So a dedicated margin or profit calculator is usually a $9 to $19 purchase.
Before you pay, check these points on the product page:
- Which app. Look for a real .xlsx file in the file list. If you work in Google Sheets, check that the listing says it was tested there: some Excel features, like certain charts and macros, do not survive the import.
- Formulas you can read. A good calculator lets you click a cell and see the formula. Locked cells are fine for protection, but you should be able to unlock them if your fees change.
- Your fee structure. A calculator built for one marketplace hard-codes its fees. Look for an input cell for the fee rate and a fixed per-order amount.
- Currency. Check that the currency symbol is a format, not text pasted into the cell, so you can switch it.
- Preview images. Screenshots of the actual tabs tell you more than the description. If there is one cover image and nothing else, ask the seller a question first.
- Licence. On the measured shelf, 56.8% of listings allow commercial use, 27.6% are for personal use only, and 12.9% state no licence. Among the profit and margin calculators, 54.1% are commercial and 43.2% personal. Personal use is enough to run your own shop. If you build sheets for clients or want to resell an edited version, you need commercial terms, and you should read what the listing allows. On Getly each product has one price and one licence, with no paid upgrades; if you need other terms, message the seller before you buy.
Buying and downloading on Getly
You can pay by card, with Apple Pay or Google Pay where your device supports it, or with USDT or USDC stablecoins. PayPal is not accepted. You do not need an account: the receipt email carries the download links. If you do keep the purchase in your library, it stays there with no expiry date, each file can be downloaded up to 25 times. The default refund window is 30 days, though a seller can set its own, so check the product page. Browse the full shelves in Spreadsheets & Calculators and Excel Templates, and compare two or three calculators against the checklist above before you pick one.


