← All how-to recipes

How to add tax to a price (and back it out again)

✓ Verified in LibreOffice 25.8.7.3

Compute a price including sales tax or VAT — and recover the pre-tax amount from a total.

The formula

AppFormulaNotes
Excel=ROUND(A2*(1+B2),2)A2=net price, B2=tax rate (e.g. 9.5%). To back out: =ROUND(A2/(1+B2),2).
Google Sheets=ROUND(A2*(1+B2),2)Identical.
LibreOffice Calc=ROUND(A2*(1+B2),2)Identical.

How it works

Adding tax is multiplying by (1 + rate): $80 at 9.5% is 80 × 1.095 = $87.60. Going the other way, divide — don't multiply by (1 − rate): a $87.60 total at 9.5% is 87.60 / 1.095 = $80.00, whereas 87.60 × 0.905 gives the wrong $79.28. That asymmetry is the classic VAT-removal mistake. ROUND to 2 decimals in the formula so invoice lines sum to the displayed total.

Verified, not just documented

We ran =ROUND(A2*(1+B2),2) in LibreOffice 25.8.7.3 (headless, with forced recalculation) and it returned 87.6 — exactly the expected result. Every formula here is confirmed by actually executing it.