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

Working on a sheet you inherited? Run the Auditor on the whole file first — it flags every #REF!, #N/A, broken column pattern, and inconsistent formula in seconds, free, no signup.

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

Related tasks

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

Last reviewed: