Don't hardcode: how to store a tax rate for formulas in Google Sheets

On this page
- How to store a tax rate for formulas in Google Sheets, step by step
- Give the cell a name
- Find the hardcoded rates already in your file
- Mistakes that quietly break a stored rate
- When one rate is not enough
- What happens to old sales when the rate changes
- Where the manual approach stops scaling
- Action steps
- Frequently asked questions
- Should I use a named range or a cell reference for the tax rate?
- Why does my tax come out as zero after I copy the formula down?
- Does this work in Excel too?
- How do I stop old sales from changing when the rate changes?
- Which tax rate should I use?
If you want to know how to store a tax rate for formulas in Google Sheets, the answer is one cell with a name. Every formula then points at that cell instead of carrying its own 0.08. When the rate changes, you edit one value and every formula updates. This post shows the setup, the mistakes that break it, and what to do when one rate is not enough.
Hardcoding looks harmless on day one. A formula like =B2*0.08 works, so you copy it down 400 rows. Then the rate changes, and you have to hunt for every copy, including the ones on other tabs and in older files. Miss one, and your totals disagree with each other without a single error message.

How to store a tax rate for formulas in Google Sheets, step by step
Create a tab called Settings. Type Sales tax rate in A1, then format B1 as a percentage before you type 8% into it. Sheets stores that value as 0.08. The 8% is only an example, so confirm the rate that applies to your sales with your tax authority or accountant, because rates vary by place and by product.
Next, refer to that cell with an absolute reference. If your prices sit in column B, these three formulas cover most needs:
- Tax only:
=B2*Settings!$B$1 - Price plus tax:
=B2*(1+Settings!$B$1) - Tax rounded to cents:
=ROUND(B2*Settings!$B$1,2)
The dollar signs matter. Without them, Sheets shifts the reference down a row each time you copy the formula, so row 3 reads Settings!B2, which is empty. The tax then shows as zero, and nothing warns you. Press F4 on Windows after clicking the cell, or type the dollar signs yourself.
Give the cell a name
A name makes the formula readable. Select Settings!B1, open the Data menu, choose Named ranges, and call the cell TaxRate. Excel does the same job through Formulas, then Define Name. Your formula becomes =B2*TaxRate, which you can read aloud to a colleague. Names cannot contain spaces or look like a cell address such as A1, so keep them plain.
Find the hardcoded rates already in your file
Most workbooks already have a few typed rates hiding inside formulas. In Sheets, press Ctrl+H, type 0.08 in the Find box, and tick the option to search within formulas. Use Find, not Replace all, because the same number might be a discount somewhere else. In Excel, press Ctrl+F, open Options, and set Look in to Formulas. Fix each hit by hand, then compare your totals before and after.
Mistakes that quietly break a stored rate
These four mistakes cause most of the wrong totals:
- Typing 8 into a cell formatted as a number. Your formulas then apply 800%. Format the cell as a percentage first, then type the rate.
- Storing the rate as text. Pasting from a web page can do this, and the value often sits on the left side of the cell. Retype it.
- Removing tax the wrong way. To get the price before tax, use
=B2/(1+TaxRate), not a multiplication by one minus the rate. - Adding tax twice. Google's ecommerce documentation for Google Analytics 4 shows purchase data with tax as its own field, and its sample describes value as the sum of price times quantity. Check whether an exported total already includes tax before you add it again.
When one rate is not enough
Learning how to store a tax rate for formulas in Google Sheets gets harder when the rate depends on where you sold something. One Google Docs Editors Community thread shows a home business owner who sells at farmers markets and craft fairs, each in a different city or county. The owner wanted sales rows pulled into separate tax tabs by location, and the recommended answer used QUERY inside LET. For the rate itself, a small lookup table is simpler.
| Location | Rate |
|---|---|
| Market A | 8% |
| Market B | 7.5% |
Name that table range Rates, then look up the location from column C: =IFNA(VLOOKUP(C2,Rates,2,FALSE),"Check location"). The FALSE forces an exact match. IFNA catches only a missing location, so other errors still show up, whereas IFERROR would hide them. If you prefer INDEX and MATCH, the Formula Foundry guide to INDEX MATCH walks through it. The rates in the table are placeholders, so use your own.
What happens to old sales when the rate changes
Overwriting the one cell fixes future sales but rewrites history. Every old row recalculates at the new rate, which is wrong for invoices you already issued. The fix is to store each rate with a start date and look it up by the sale date.
| Start date | Rate |
|---|---|
| 2025-01-01 | 8% |
| 2026-07-01 | 8.5% |
Name that range RateHistory and add a helper column D beside each sale: =VLOOKUP(A2,RateHistory,2,TRUE). With TRUE, the lookup returns the last row whose start date falls on or before the sale date in A2. Tax in column E is then =ROUND(B2*D2,2). Keep start dates sorted oldest first, or the lookup returns the wrong rate. A sale dated before your first row returns #N/A, which works as a useful warning.
Bracketed taxes work differently, because each slice of income is taxed at its own rate. Exceljet's income tax bracket calculation shows this: the first $11,925 is taxed at 10%, which gives $1,193. That needs a bracket table and a formula that adds up the slices, not a single lookup. The Settings-tab habit still applies, though, since the thresholds and rates belong in cells.
Where the manual approach stops scaling
Storing a tax rate for formulas in Google Sheets with named ranges has clear limits. A Settings tab works well inside one workbook, but it stops working when you copy a tab into another file, when a colleague overwrites a name, or when the same rate has to live in both an Excel file and a Sheets file. Each copy carries its own value, so you are updating several places again. Formula Foundry's shared variables keep one value across the workbook, and its snippet library lets a team reuse tested formulas instead of copying from old files. You can also draft a formula step by step in the Formula Foundry playground.
The same habit helps reports. In Ben Collins' dashboard posts, a formula such as =COUNTIF('ejunkie staging data'!$S$4:$S,D25) takes its criterion from cell D25 rather than typed text, so changing D25 changes the result. Your tax rate deserves the same treatment. For more habits like this, read our guide to formulas in Google Sheets that cut errors.
Action steps
- Create a Settings tab: Put the label in A1, format B1 as a percentage, then type your rate into B1.
- Name the cell: Use Data, then Named ranges, to call it TaxRate, and write formulas such as =B2*TaxRate.
- Hunt down typed rates: Search within formulas for the old number, review each hit, and replace it by hand.
- Add a lookup if rates differ: Build a small table of locations and rates, then use IFNA with VLOOKUP and FALSE.
- Add start dates: Store each rate with a start date, sorted oldest first, and look it up by the sale date in a helper column.
Frequently asked questions
Should I use a named range or a cell reference for the tax rate?
Both work. A cell reference such as Settings!$B$1 needs the dollar signs to stay fixed when you copy it. A named range such as TaxRate reads more clearly and cannot drift when you copy formulas.
Why does my tax come out as zero after I copy the formula down?
The reference to the rate cell probably has no dollar signs, so it moved down a row and now points at an empty cell. Add the dollar signs or switch to a named range.
Does this work in Excel too?
Yes. Excel supports the same Settings tab, absolute references, and named ranges through Formulas, then Define Name. VLOOKUP and ROUND behave the same way in both.
How do I stop old sales from changing when the rate changes?
Keep a table of start dates and rates, then look up the rate by the sale date in a helper column. Each row keeps the rate that applied on its own date.
Which tax rate should I use?
That depends on your location, products, and tax status. Confirm the correct rate with your tax authority or an accountant, then enter it in your Settings tab.