FormulaCraft

How to calculate gross margin in Excel and Google Sheets

Topic:Finance basics
Excel & Google Sheets
=B2-C2/B2

Verified example

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

RevenueCost of Goods SoldGross Margin
1000400

=B2-C2/B2400

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. 1Enter your sales revenue in cell B2.
  2. 2Enter your cost of goods sold in cell C2.
  3. 3In cell D2, enter the formula =B2-C2/B2 to calculate the gross margin.

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 is gross margin?

Gross margin is the percentage of revenue that exceeds the cost of goods sold.

Can I use this formula for services?

Yes, replace 'cost of goods sold' with the direct costs associated with providing the service.

Why am I getting an error?

Ensure that your revenue is not zero and that both revenue and cost inputs are numerical values.

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: