FormulaCraft

How to calculate gross margin in Excel and Google Sheets

Topic:Finance basics
Excel & Google Sheets
=(B2-A2)/B2

Verified example

Computed by a real spreadsheet engine on the sample data below.

CostPrice
60100

=(B2-A2)/B20.4

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

Step by step

  1. 1Subtract cost from price to get profit: B2-A2.
  2. 2Divide by the price (B2) — margin is relative to revenue, not cost.
  3. 3Format as a percentage to read it (e.g. 0.4 = 40%).

Tips

Need it for your exact data?

Describe your columns in plain English and get the precise formula for your sheet, with the right Excel or Sheets syntax.

Frequently asked

What's the difference between margin and markup?

Margin is profit ÷ price; markup is profit ÷ cost. The same dollar profit gives a smaller margin than markup.

More on Finance basics

See all →

Formulas used

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: