How to calculate selling price from cost and a target margin in Excel
Formula (Excel and Google Sheets)
=B2/(1-$F$1)Divide the cost by 1 minus the margin: =B2/(1-$F$1). A $30 item at a 40% margin sells for $50.
- Result on the example
- one result per row in
C2, filled down toC6 - Works in
- Every current version
- Google Sheets
- Same formula
See it work
The formula is already in C2, filled down to C6. Change any input and the result updates, or edit the formula to experiment.
How it works
Margin is profit as a share of the price, so at a 40% margin the cost is the other 60% of the price. Dividing the cost by 1-$F$1 gives the price: 30 / 0.6 = 50, which leaves 20 of profit, 40% of 50.
=B2/(1-$F$1)Result50
B2$30.00The value in B2.
$F$140%The value in F1.
1-$F$10.6The - operator subtracts.
B2/(1-$F$150The / operator divides.
In Google Sheets
The same formula works in Google Sheets: =B2/(1-$F$1). We ran it in Google Sheets mode on the same data and it returns the same results.
Other ways to do it
Each one was run on the same example sheet.
| Formula | Result | When to use it |
|---|---|---|
| =B2*(1+$F$1) | $42.00, $87.50, $196.00…Different result | Adds 40% to the cost, which is a 40% markup, not a 40% margin. Prices are too low: the notebook sells for $42, a 28.6% margin. |
Common mistakes
- Adding the margin percentage to the cost gives a lower margin than you aimed for.
- A margin of 100% or more is impossible (the formula divides by zero or goes negative): the cost can never be zero percent of the price.
Try it yourself
Same data, empty answer cell. Your formula is graded instantly, then re-checked on changed data, so a typed-in number won't pass.
Calculate selling price from cost and a target margin
C2, calculate the selling price that gives the margin in F1, then fill down to C6.Questions
How do I check the margin of a price?
Divide the profit by the price: =(C2-B2)/C2.
How do I round the price to end in .99?
Round up to a whole number and subtract a cent: =ROUNDUP(B2/(1-$F$1),0)-0.01.
Checked by running on 2026-10-30: every formula and result on this page was calculated by the Spreadsheet Practice formula engine, in both Excel and Google Sheets modes.