Profit margin in Excel: formulas and sheet layout

Three formulas, a pricing sheet template, and conditional formatting to flag problem SKUs. Works the same in Google Sheets.

The three formulas you need

In Excel or Google Sheets, the three core profit margin calculations are simple cell references. Set up two columns — Cost and Price — and the rest computes from there.

Profit (dollar amount)

=B2-A2   where A2 is cost, B2 is price

Profit margin %

=(B2-A2)/B2

Then format the cell as a percentage (Ctrl+Shift+5 in Excel, or Format → Number → Percent).

Markup %

=(B2-A2)/A2

A complete pricing sheet

Here's a layout that gives you everything you need for a SKU-level pricing review:

ColumnLabelFormula
AProduct(text)
BCost(input)
CPrice(input)
DProfit=C2-B2
EMargin %=D2/C2
FMarkup %=D2/B2
GMargin status=IF(E2<0,"Loss",IF(E2<0.1,"Tight",IF(E2<0.2,"OK","Healthy")))

Solving for the other variable

Find price from cost and target margin

=B2/(1-target_margin)

So if your cost is $10 in B2 and you want a 40% margin: =B2/(1-0.4) → $16.67.

Find price from cost and target markup

=B2*(1+target_markup)

Cost $10, 60% markup: =B2*(1+0.6) → $16.

Find cost from price and target margin

=C2*(1-target_margin)

Conditional formatting for margin health

Highlight rows that need attention:

  1. Select your margin column (E2 onwards).
  2. Home → Conditional Formatting → New Rule → Format cells based on value.
  3. Add three rules: red for < 10%, yellow for 10–20%, green for ≥ 20%.

Now your sheet visually flags problem SKUs at a glance.

Adding fees and shipping

For a more realistic net margin, expand the sheet:

ColumnLabelFormula
HPlatform fee %(input, e.g. 2.9%)
IPlatform fee flat(input, e.g. $0.30)
JShipping cost(input)
KTotal fees=C2*H2+I2+J2
LNet profit=D2-K2
MNet margin=L2/C2

For platform-specific fee rates, see the presets in our main calculator — Stripe, PayPal, Amazon, Etsy, Shopify, eBay, and more, with regional variants.

Pivot tables for product mix analysis

With margin and markup on every SKU, drop your sheet into a pivot table to see margin by category, by supplier, or by price band. Adding a "Category" column at column N and pivoting Category × average margin reveals which parts of your catalog deserve attention.

Frequently asked

Does this work the same in Google Sheets?

Yes — all the formulas above are identical in Google Sheets. The only difference is the conditional formatting menu path (Format → Conditional formatting).

Why is my margin showing as 0.40 instead of 40%?

The cell isn't formatted as a percentage. Select the cell and press Ctrl+Shift+5 in Excel, or change Format → Number → Percent in Google Sheets.

Should I lock my cost cells?

If you're copying formulas down, use absolute references ($B$2) for any cell that should stay fixed (like a tax rate or platform fee constant). Use relative references (B2) for the per-row cost and price.

Try the calculator

Free, no signup. Includes platform fees, shipping, and tax.

Open calculator →