Calculate Gross Margin Excel

If you just need to calculate gross margin excel and move on, the boxed answer at the top is all you need. The rest of this page is for when you want to understand why it works in Excel, adapt it to a trickier version, or make it robust enough to hand to a colleague. We keep the opening short on purpose — the depth is here when you want it, not in your way when you don’t.

Exact answer

In Excel: margin is profit divided by the selling price: =(Price-Cost)/Price, formatted as a percentage.

On this page7
▤Annotated stepsExcel
1

Put the selling price and the cost in their own columns so both are visible and auditable.

2

Enter =(B2-C2)/B2 and format the result as a percentage with Ctrl+Shift+% .

3

To price from a target margin, use =C2/(1-D2) where D2 holds the target as a percentage.

4

To convert an existing markup to the equivalent margin, use =E2/(1+E2).

5

Keep gross and net margin in separate columns if overheads are involved — they answer different questions and get confused when they share a label.

=(B2-C2)/B2
Ctrl+CthenCtrl+Shift+V⌘+Cthen⌘+Ctrl+VPaste values · WindowsMac

What this does

Margin and markup use the same profit in the numerator and different denominators, which is why the two numbers never agree and why quoting one as the other misprices a product. Margin divides profit by the price, so it answers what share of revenue you keep and can never reach 100%. Markup divides the same profit by the cost, so it answers how far you marked the item up and has no upper limit. Keep the inputs visible and clearly labelled and the whole thing stays auditable — anyone who opens the file later, including you, can see at a glance exactly what feeds the result and change one assumption without hunting through the formula. The difference between a quick fix and a sheet you can trust is the extra minute you spend validating “calculate gross margin excel”. Start on a copy or a tiny sample, keep the affected cells visible, and compare the result with the outcome you expected before you touch the real workbook. When a formula is involved, keep the inputs labelled beside it, reference cells instead of typing values, and apply number formatting only after the result checks out. The point is a calculation you can defend to a CFO or an auditor, but the practical win is that someone else can open the file and understand what happened without asking you.

A worked example

An item costs 60 and sells for 100. Margin is (100-60)/100 = 40%. Markup on the same pair is (100-60)/60 = 66.7%. To hit a target margin instead, work backwards: price = cost / (1 - margin), so 60 / (1 - 0.40) = 100. The two ratios are one keystroke apart in a spreadsheet and several points apart in the price list, and the mistake only surfaces when the year-end gross profit misses plan. Check the referenced cells, argument order and result type in your workbook. Start with the worked example before changing an input, then compare the changed result with the calculation you expected. An error value or a result of a different type is a reason to inspect the inputs and arguments.

In Google Sheets

Google Sheets support for this task has not been verified. Check the function, arguments and workflow in the target product before transferring the example. Matching formula notation does not establish identical behaviour. Keep this page bookmarked for the next time the same question comes up. Better still, repeat the steps once in your own workbook — doing it yourself is what turns a copied answer into something you remember. For “calculate gross margin excel”, keep the input cells and the result visible while you check the formula in Excel. Follow the worked example and change one input at a time. The steps explain the workbook calculation; this page does not run a live calculator for that task.

Common mistakes

  • Dividing profit by cost and labelling it margin, which overstates the figure on every item.
  • Adding a 40% markup and reporting a 40% margin: the first gives a 28.6% margin, and the gap grows as the numbers rise.
  • Averaging the margin percentages of several products instead of computing total profit over total revenue.
  • Leaving the result as a decimal, so 0.4 is read as 0.4% in a report.

Frequently asked questions

What is the difference between margin and markup?

Margin divides profit by the price, markup divides the same profit by the cost. A 50% markup is a 33.3% margin.

How do I price for a target margin?

=Cost/(1-Margin). For a 35% margin on a cost of 65, that is 65/0.65 = 100.

How do I convert markup to margin?

=Markup/(1+Markup), and back again with =Margin/(1-Margin).

Can margin exceed 100%?

No. Profit cannot exceed the price it is measured against, so a figure above 100% means markup was computed instead.