Different states or regions, different tax rates. Keep the rates in a small table and let VLOOKUP (or XLOOKUP) pull the right one by region code — so updating a rate never means editing a formula.
FALSE forces an exact region match. Multiply the matched rate by the order amount for the tax.
The example
A Texas order taxed at the TX rate from the table.
| A | B | C | |
|---|---|---|---|
| 1 | Region | Rate | |
| 2 | CA | 7.25% | |
| 3 | TX | 6.25% | |
| 4 | NY | 4.00% | |
| 5 | $200 order in TX → tax | $12.50 |
The formula
Match the region, apply the rate:
How it works
An exact-match lookup keeps rates out of your formulas:
- Build a rate table: region code in the left column, tax rate beside it. Order doesn’t matter for exact match.
VLOOKUP(region, table, 2, FALSE)returns the matching rate. FALSE means exact match — essential for codes.- Multiply by the order amount for the tax. When a rate changes, edit the table; every formula updates.
- In Excel 365,
XLOOKUP(region, regions, rates)does the same and lets you add an “if not found” message.
Catch unknown regions: a missing code returns #N/A with VLOOKUP. Wrap it: =IFERROR(VLOOKUP(…), 0) to default to zero tax, or use XLOOKUP(…, "rate?") to flag it for review rather than silently charging nothing.
Try it: interactive demo
Pick a region and amount.
Variations
XLOOKUP (365)
With a not-found message:
Default to zero
Unknown region → 0 tax:
Tax-inclusive back-out
Extract tax from a gross price:
Pitfalls & errors
Use FALSE for codes. Region codes need exact match. Approximate match (TRUE) on unsorted text returns garbage.
Handle #N/A. An unknown region errors. Wrap with IFERROR or XLOOKUP’s not-found argument so orders don’t break.
Trailing spaces in codes. “TX ” won’t match “TX”. TRIM the lookup value if data entry is messy.
Practice workbook
Frequently asked questions
How do I look up sales tax by region in Excel?
How do I handle an unknown region?
How do I extract tax from a tax-inclusive price?
Stop fighting formulas. Learn them in a day.
This recipe is one of hundreds of real-world formulas we teach. Our Excel Formulas & Functions class covers lookups, logic, text, and dynamic arrays hands-on — live in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.
See the Formulas & Functions Class