Markup and margin both measure profit against a selling price or cost, but they use different denominators, so the percentages are not interchangeable.
This guide explains the Excel formulas for each, how to convert between them, and how to avoid common pricing errors.
Markup vs. margin: what is the difference?
Markup compares profit with cost.
Margin compares profit with the selling price, also called revenue.
Both use the same profit amount, but their different bases produce different percentages.
- Profit: selling price minus cost
- Markup percentage: profit divided by cost
- Margin percentage: profit divided by selling price
For example, if an item costs $80 and sells for $100, its profit is $20.
The markup is $20 divided by $80, or 25%.
The margin is $20 divided by $100, or 20%.
Excel markup formula
Suppose the cost is in cell A2 and the selling price is in B2.
To calculate markup as a percentage, enter:
=(B2-A2)/A2
Format the result cell as a percentage.
With a cost of 80 and a selling price of 100, the expected result is 25%.
The formula first calculates profit with B2-A2, then divides that profit by cost, A2.
To show the markup as a decimal instead of a percentage, keep the formula and use a number format such as General; the result for this example is 0.25.
Calculate a selling price from cost and markup
If cost is in A2 and the target markup percentage is in C2, calculate the selling price with:
=A2*(1+C2)
Enter the target as a percentage, such as 25% or 0.25.
For an $80 cost and 25% markup, the formula returns $100.
Excel margin formula
Using cost in A2 and selling price in B2, calculate margin with:
=(B2-A2)/B2
Format the result as a percentage.
For an $80 cost and a $100 selling price, the expected result is 20%.
Because margin divides profit by selling price, the selling price is the denominator.
Calculate a selling price from cost and target margin
To find the selling price needed for a target margin, use a different formula than the markup pricing formula.
If cost is in A2 and the target margin is in C2, enter:
=A2/(1-C2)
For an $80 cost and a 20% target margin, this returns $100.
The denominator matters: a 20% margin means cost represents the remaining 80% of the selling price.
Convert markup to margin and margin to markup
When you know one percentage and need the other, use these relationships:
- Margin from markup: markup divided by one plus markup
- Markup from margin: margin divided by one minus margin
If a markup percentage is in C2, convert it to margin with:
=C2/(1+C2)
A 25% markup converts to a 20% margin.
If a margin percentage is in C2, convert it to markup with:
=C2/(1-C2)
A 20% margin converts to a 25% markup.
Enter the percentage as a numeric percentage value, such as 20%, and format the formula result as a percentage.
Worked example with a small price table
Enter the following headings and values in Excel:
| Cell | Value | Meaning |
|---|---|---|
A1 | Cost | Product cost |
B1 | Selling Price | Customer price |
A2 | 80 | Cost |
B2 | 100 | Selling price |
In C1, type Profit, then enter =B2-A2 in C2.
The result is 20.
In D1, type Markup, then enter =(B2-A2)/A2 in D2; the result is 25%.
In E1, type Margin, then enter =(B2-A2)/B2 in E2; the result is 20%.
To reuse the calculations for more products, copy the formulas down the columns.
Relative references such as A2 and B2 will adjust for each row.
Common errors and edge cases
- Using the wrong denominator: dividing profit by cost calculates markup; dividing profit by selling price calculates margin.
- Confusing percentage and decimal entry: type
20%or0.2for a 20% rate.
Typing20into a percentage input means 2,000% in a formula. - Zero cost: the markup formula divides by cost, so it cannot return a meaningful result when cost is zero.
Use=IF(A2=0,"",(B2-A2)/A2)to leave the result blank in that case. - Zero selling price: margin divides by selling price.
If the selling price is zero, the margin is undefined; guard against division by zero with=IF(B2=0,"",(B2-A2)/B2). - Target margin of 100%: the pricing formula
=A2/(1-C2)divides by zero whenC2is 100%.
A target margin below 100% is required for a finite price with positive cost. - Discounts, fees, and taxes: decide which amounts count as cost before calculating.
Shipping, payment fees, discounts, and sales tax can change the profit figure or the revenue basis, depending on your accounting definition.
Excel and Google Sheets compatibility
These formulas use basic arithmetic and standard cell references, so they work in current desktop and web versions of Microsoft Excel and Google Sheets.
The formulas do not require a special function or a recent spreadsheet version.
Use the percentage number format to display rates clearly; changing the cell format affects display, not the underlying calculation.
If your spreadsheet uses semicolons as function argument separators because of regional settings, that only affects formulas with functions such as IF.
The basic markup, margin, and price formulas shown above contain no function arguments and need no separator changes.