Pricing & Cost Calculators

Profit Margin Calculator in Excel: Margin vs Markup Formulas

Build a profit margin calculator in Excel or Google Sheets: the margin and markup formulas, how to convert one into the other, how to price for a target margin and the mistakes that cost sellers money.

Short answer: profit margin is profit divided by the selling price; markup is profit divided by the cost. In Excel, with the cost in B2 and the price in B3, margin is =(B3-B2)/B3 and markup is =(B3-B2)/B2. To find the price that gives a target margin, divide the cost by one minus the margin: =B2/(1-B5). Mixing the two measures up is one of the most common ways small sellers underprice.

This guide explains both measures, shows how to convert between them and walks through a small calculator you can build in a few minutes. The formulas work the same in Excel and Google Sheets, and each one below was tested in a spreadsheet.

Margin and markup in plain words

Profit margin Markup
Question it answers How much of each sale is profit? How much did I add on top of cost?
Formula (price − cost) ÷ price (price − cost) ÷ cost
Cost $18.50, price $29.95 $11.45 ÷ $29.95 ≈ 38.2% $11.45 ÷ $18.50 ≈ 61.9%
Can it exceed 100%? No (unless cost is negative) Yes

The profit in dollars is the same either way: $11.45. Only the base of the percentage differs. That is why a “50% markup” and a “50% margin” give very different prices.

Converting between margin and markup

  • Margin from markup: margin = markup ÷ (1 + markup)
  • Markup from margin: markup = margin ÷ (1 − margin)
Markup Equals a margin of
25% 20%
33.3% 25%
50% 33.3%
100% 50%
150% 60%
200% 66.7%
300% 75%

Doubling your cost (a 100% markup) gives a 50% margin, not 100%. Retail’s “keystone” pricing — doubling the wholesale price — works the same way.

Build the calculator

Open a blank sheet, type the labels in column A and the values or formulas in column B. Format B5, B6, B9, B10, B13 and B14 as percentages.

Cell Label Value or formula
B2 Cost per item 18.50
B3 Selling price 29.95
B5 Target margin 30%
B6 Target markup 50%
B8 Profit per item =B3-B2
B9 Profit margin =IF(B3=0,"",(B3-B2)/B3)
B10 Markup =IF(B2=0,"",(B3-B2)/B2)
B11 Price for target margin =B2/(1-B5)
B12 Price for target markup =B2*(1+B6)
B13 Margin equal to the target markup =B6/(1+B6)
B14 Markup equal to the target margin =B5/(1-B5)

With the example values, the sheet shows a profit of $11.45, a margin of 38.2% and a markup of 61.9%. A 30% target margin needs a price of $26.43; a 50% markup gives $27.75, which is only a 33.3% margin. If you want prices that end in .95, wrap the target-margin formula like this: =ROUNDUP(B2/(1-B5),0)-0.05, which returns $26.95.

Turn it into a product list

To check many products at once, put one product per row with columns for name, cost and price, select the range and press Ctrl+T to make it a table. Add margin and markup columns with formulas such as =([@Price]-[@Cost])/[@Price]; the table fills them for every row. Sort by margin to see which products carry the business and which barely cover their costs. In Google Sheets, use ordinary references such as =(C2-B2)/C2 and fill down.

What counts as cost

A margin is only as honest as the cost you enter. For a product you make, cost usually means materials and packaging, your production time and a share of overhead — our guide on how to price handmade products shows how to calculate each. For a product you resell, it is the purchase price plus inbound shipping.

Marketplace and payment fees are not part of product cost, but they come out of the price, so a margin calculated before fees overstates what you keep. On Etsy, for example, a US seller pays 6.5% plus 3% and fixed fees on each order; our Etsy profit calculator shows how to include them.

Gross margin and net margin

  • Gross margin uses direct product costs only. It is the figure the calculator above produces for one product.
  • Net margin uses all costs of the business, including advertising, software and rent, and is read from your profit and loss statement — see how to read a profit and loss statement.

A product can have a healthy gross margin while the business as a whole loses money, if overhead and advertising are too high for the sales volume.

Common mistakes

  • Adding the margin percentage to cost. Cost × 1.30 is a 30% markup, which is only a 23% margin.
  • Calculating margin on the price including sales tax. Tax is not your revenue; use the price before tax.
  • Forgetting discounts. A 20% off sale on a product with a 30% margin removes two-thirds of the profit.
  • Ignoring fees and shipping. Check margins after the fees of the channel where you sell.
  • Using old costs. Update costs when material or supplier prices change.

Frequently asked questions

Is a 50% markup the same as a 50% margin?

No. A 50% markup on a $20 cost gives a $30 price and a 33.3% margin. A 50% margin needs a $40 price, which is a 100% markup.

Which should I use for pricing?

Margin is easier to compare with your profit and loss statement, because both are shares of sales. Markup is convenient for quick pricing from cost. Use whichever you like, as long as you know which one you are using.

How do I calculate the discount I can afford?

The maximum discount before you start losing money on an item equals its margin. With a 38% margin, a discount above 38% sells the item below cost — before fees.

Does the formula work in Google Sheets?

Yes. All the cell formulas above work in Google Sheets; only the table references in the product-list example need ordinary cell references instead.

Pricing & Cost Calculators · November 4, 2026

How to Price Handmade Products: A Step-by-Step Formula

A step-by-step way to price handmade products: count every material, pay yourself for your time, share out overhead, add profit, cover selling fees and then test the price against the market.

Read guide