How to work out margin on a quote in Google Sheets
A quote can look healthy and still lose money, because the total says nothing about what the goods cost you. Margin is the figure that does.
The steps are for Google Sheets. The example is a shop selling mugs, plates and teapots, with no currency assumed, and it carries on from the price list guide.
Add what each product costs you
On the Price list tab, add a Unit cost column in D:
| SKU | Product | Unit price | Unit cost |
|---|---|---|---|
| M-101 | Blue mug | 299 | 120 |
| P-201 | Dinner plate | 449 | 180 |
| T-401 | Teapot | 999 | 420 |
Unit cost is what one unit costs you to buy or make. Decide once whether it includes freight and packaging, and apply that to every product. Unit price here is the price before tax. If your prices include tax, take the tax out first.
Set up the quote lines
Add a tab called Quote with these headers in row 1:
| A | B | C | D | E | F | G | H | I |
|---|---|---|---|---|---|---|---|---|
| SKU | Quantity | Discount | Unit price | Unit cost | Net | Cost | Margin | Margin % |
Columns A to C are typed. Leave Discount empty when there is none. Put these in D2 to I2:
Unit price =IF(A2="", "", XLOOKUP(A2, 'Price list'!A:A, 'Price list'!C:C))
Unit cost =IF(A2="", "", IF(XLOOKUP(A2, 'Price list'!A:A, 'Price list'!D:D)="", "No cost", XLOOKUP(A2, 'Price list'!A:A, 'Price list'!D:D)))
Net =IF(A2="", "", ROUND(B2*D2*(1-C2), 2))
Cost =IF(A2="", "", ROUND(B2*E2, 2))
Margin =IF(A2="", "", F2-G2)
Margin % =IF(A2="", "", IF(F2=0, "", H2/F2))
Fill all six down to row 200. Select column I, choose Format > Number and pick the percentage format.
XLOOKUP finds the SKU on the price list and returns the price or the cost from the same row. Google's page gives #N/A as the result when nothing matches, so a mistyped SKU shows an error.
The Unit cost formula is longer for a reason. A product with an empty cost cell would count as costing nothing, and the line would show a margin of 100%. The formula writes "No cost" there, and the Cost, Margin and Margin % cells on that line then show an error until the cost is filled in.
Now the quote totals. Type the labels in K1 to K4 and these beside them:
| K | L |
|---|---|
| Net total | =SUM(F2:F200) |
| Cost total | =SUM(G2:G200) |
| Margin | =L1-L2 |
| Margin % | =IF(L1=0, "", L3/L1) |
Format L4 as a percentage too.
Check it against three lines
Type columns A to C and the rest should appear:
| SKU | Quantity | Discount | Unit price | Unit cost | Net | Cost | Margin | Margin % |
|---|---|---|---|---|---|---|---|---|
| M-101 | 12 | 299 | 120 | 3,588.00 | 1,440.00 | 2,148.00 | 59.87% | |
| P-201 | 60 | 20% | 449 | 180 | 21,552.00 | 10,800.00 | 10,752.00 | 49.89% |
| T-401 | 2 | 999 | 420 | 1,998.00 | 840.00 | 1,158.00 | 57.96% |
Work the plates through by hand. 60 at 449 is 26,940, and less 20% is 21,552. The plates cost you 60 times 180, which is 10,800. That leaves 10,752, and 10,752 divided by 21,552 is 49.89%.
The totals block should read 27,138.00 net, 13,080.00 cost, a margin of 14,058.00 and a margin of 51.80%.
Do not average the line percentages
The three line percentages average out at 55.90%. The quote's real margin is 51.80%. The average is wrong because it gives 2 teapots the same weight as 60 plates, and the plates are four fifths of the money on this quote.
So the quote's margin percentage is always total margin divided by total net, which is what L4 does.
See what a discount takes out of the margin
A discount comes off the price. The cost stays where it was, so the whole discount comes out of your margin.
Take the plates. At full price, 60 plates bring in 26,940 and leave a margin of 16,140. The 20% discount is 5,388. Your cost is still 10,800, so the margin drops to 10,752. A fifth off the price took a third off the profit.
The thinner the margin to begin with, the harder a discount bites. If the plates cost you 320 each, the full-price margin would be 7,740 and the same 20% discount would leave 2,352.
Margin is not markup
Both start from the same profit and divide it by different things. Take one blue mug, bought at 120 and sold at 299, a profit of 179:
| Divide the profit by | Blue mug | |
|---|---|---|
| Margin | The selling price | 179 / 299 = 59.87% |
| Markup | The cost | 179 / 120 = 149.17% |
Mixing them up costs money when you set a price. Say a product costs 120 and you want a margin of 40%. Adding 40% to the cost gives 168, and the margin on 168 is only 48 divided by 168, which is 28.57%. To get a margin of 40%, divide the cost by one minus the margin: 120 divided by 0.6 is 200. In a cell, with the cost in E2: =ROUND(E2/(1-0.4), 2).
Find the largest discount you can give
Decide the lowest margin you will accept and type it on a Settings tab, for example Minimum margin in A4 and 40% in B4. Type Max discount in J1 of the Quote tab and put this in J2:
=IF(A2="", "", ROUNDDOWN(1-E2/(D2*(1-Settings!$B$4)), 3))
Fill it down and format the column as a percentage. It shows 33.1% for the mugs and the plates and 29.9% for the teapots. Check the plates: at 33.1% off, a plate sells for 300.38, the margin is 120.38, and 120.38 divided by 300.38 is just over 40%. ROUNDDOWN is there so the figure never rounds up past the limit.
To colour the lines that fall below the minimum:
- Select I2 down to I200.
- Choose Format > Conditional formatting.
- Under Format cells if, pick Custom formula is and enter
=AND(ISNUMBER($I2), $I2<0.4). - Choose a fill colour and click Done.
The 0.4 is typed into the rule because Google's page on conditional formatting says a custom formula can only reference the same sheet. Change it if you change Settings.
Include the costs that are not products
If you pay for delivery and do not charge for it, the quote still carries that cost. Add it to the price list as its own row, for example DEL-01, Delivery, unit price 0 and unit cost 350. On the quote, a line with DEL-01 and quantity 1 shows a net of 0, a cost of 350 and a margin of -350. The totals become 13,430.00 cost, a margin of 13,708.00 and a margin of 50.51%.
Keep cost and margin away from the customer
The cost and margin columns are for you. Hiding them is not enough if you share the file: Google's page on hiding columns says a click on the arrow brings a hidden column back. Send a printout or PDF of the customer's part only. Select the cells the customer should see, choose File > Print and pick Selected cells, which Google's page on printing lists as an option.
Where BoltSheets fits
Everything above works in a plain Google Sheet. The BoltSheets quote calculator template has a Unit cost column on its price list and a Margin column on each quote, worked out the same way: subtotal after discount, less quantity times unit cost. It holds one product per quote and shows margin as an amount only. The percentage, the largest-discount column and the low-margin colour are yours to add. In the demo you can ask "What is the margin on quote Q-2001?" and the answer is read from the sheet's own Margin cell, not worked out by the assistant. BoltSheets is in early access and works with Google Sheets only. The template opens as a demo for now and is not yet a sheet you can copy.
Common questions
How do I convert a markup into a margin?
Divide the markup by one plus the markup. A 50% markup is 0.5 divided by 1.5, which is a margin of 33.3%. A 100% markup, where you sell at double the cost, is a margin of 50%.
Should margin be worked out before or after tax?
Before tax, on the net amount. Tax you add to a quote is collected to be passed on, so it is not part of your price. If your prices include tax, take the tax out first and work out the margin on what is left.
What is a good margin for a quote?
There is no single figure. The margin on a quote has to pay for rent, wages and every other running cost that is not in the unit cost. Work out what those take from each sale and set your minimum margin above it.
Why does a quote line show No cost?
The SKU is on the price list but its Unit cost cell is empty. Type the cost on the Price list tab and the line fills in. The formula stops there on purpose, because an empty cost would otherwise count as zero and show a margin of 100%.