How to calculate sales tax in Excel?
When making purchases, sales tax is a common additional cost except when buying duty-free items. Understanding how to accurately calculate the amount of sales tax you've paid is useful for both personal finance management and business accounting. In Excel, the method you use to calculate sales tax can depend on whether your price is listed as tax-exclusive (the tax is not included) or tax-inclusive (the tax is already included in the price). Each scenario requires a slightly different approach to determine the correct sales tax amount paid.
- Calculate sales tax if you get price exclusive of tax
- Calculate sales tax if you get tax-inclusive price
- Use VBA code to automate sales tax calculations in Excel
For visual reference, the following screenshot shows how data might be organized in your Excel worksheet:
Calculate sales tax if you get price exclusive of tax
Quite often, you might receive or record a product price that does not include any sales tax (tax-exclusive price). In this situation, calculating the sales tax is straightforward: simply multiply the tax-exclusive price by the sales tax rate.
This method is suitable when invoices, receipts, or price lists do not factor tax into the price and you want to determine how much tax will be due on top of the purchase amount. It can be helpful for small businesses creating invoices or for personal budgeting when planning total expenditures.
For example, if your tax-exclusive product price is listed in cell B1, and the applicable sales tax rate (expressed as a decimal, such as 0.07 for 7%) is in cell B2:
Select the cell where you want the sales tax to appear, then enter the following formula:
=B1*B2
After typing the formula, press the Enter key. The result will display the sales tax based on your input values.
For example, if B1 is 100 and B2 is 0.08, Excel will output 8, meaning the sales tax is 8 units of your currency.
Tips and notes:
- Ensure the tax rate is entered as a decimal (e.g., enter 0.08 for 8%) or percentage format. If you enter a whole number (such as 8), your result will be 8 times larger than intended.
- If your data uses different cells, adjust the formula references accordingly.
- Double-check local tax rate rules, as some products may have different rates or exemptions depending on your location. Always verify the correct tax rate to avoid errors in financial records.
The result should look like this:
If you receive an error such as #VALUE!, check that both reference cells contain numeric values, and that the tax rate is in decimal form.

Unlock Excel Magic with Kutools AI
- Smart Execution: Perform cell operations, analyze data, and create charts—all driven by simple commands.
- Custom Formulas: Generate tailored formulas to streamline your workflows.
- VBA Coding: Write and implement VBA code effortlessly.
- Formula Interpretation: Understand complex formulas with ease.
- Text Translation: Break language barriers within your spreadsheets.
Calculate sales tax if you get tax-inclusive price
Sometimes, especially in certain regions or retail environments, the price you see already includes sales tax (tax-inclusive price). To calculate the amount of sales tax contained within this figure, you must adjust your formula to extract only the tax portion.
This scenario is commonly encountered on receipts, in some e-commerce environments, or when dealing with summarized sales data. Knowing how to “reverse-calculate” the tax portion helps with accounting, expense reporting, and tax audits.
Assume the tax-inclusive price is in cell E4, and the tax rate (as a decimal) is in cell E2. To separate the amount of sales tax from the total price, proceed as follows:
Select the cell where you would like the calculated sales tax to appear, then enter this formula:
=E4-E4/(1+E2)
Press Enter to confirm the formula. The cell will then display the sales tax amount included in the original (tax-inclusive) price.
In this formula, E4/(1+E2) calculates the price before tax, then subtracts it from the total to isolate the tax. For instance, if E4 is 108 and E2 is 0.08, the result will be8, reflecting the included tax.
Helpful notes and troubleshooting:
- Always enter the tax rate as a decimal (e.g., 0.08 for 8%) or percentage format.
- This approach is ideal when you need to reconcile tax paid for reporting or when invoicing clients with tax-inclusive pricing.
- If your price cell or rate cell contains non-numeric entries, the formula may result in an error; double-check your data for accuracy.
- Adjust the cell references if your worksheet uses different locations for the price and tax rate.
The resulting sales tax will be displayed in your selected cell, as shown in the following screenshot:
In practice, choosing between these two calculation methods depends on your available data and reporting requirements. The first method is best when tax is not part of the price, and the second when the tax is already included.
Occasionally, you may want to use Excel's built-in functionality for performing such calculations across many rows or with dynamic parameters. For example, you could use named ranges instead of direct cell references to improve formula clarity, or craft a summary table to apply the calculations to a list of transactions at once. If you need to frequently calculate sales tax, consider adding input validation to ensure tax rates and prices are input correctly.
Use VBA code to automate sales tax calculations in Excel
If you frequently need to calculate sales tax on large datasets or want to automate the process, you may consider a custom VBA macro. This option is practical when standard formulas become cumbersome or when integrating with larger Excel workflows.
1. Go to Developer Tools > Visual Basic. In the Microsoft Visual Basic for Applications window, click Insert > Module, then enter the following code into the module:
Sub CalculateSalesTaxBatch()
Dim taxRate As Double
Dim rng As Range, cell As Range
Dim resultColumn As String
On Error Resume Next
xTitleId = "KutoolsforExcel"
taxRate = Application.InputBox("Enter sales tax rate (e.g., 0.08 for 8%)", xTitleId, 0, Type:=1)
Set rng = Application.InputBox("Select the range of prices (tax-exclusive)", xTitleId, Type:=8)
resultColumn = Application.InputBox("Enter column LETTER for results (e.g., B)", xTitleId, "B", Type:=2)
If rng Is Nothing Then Exit Sub
For Each cell In rng
cell.Worksheet.Cells(cell.Row, resultColumn).Value = cell.Value * taxRate
Next cell
End Sub
2. After entering the code, click the button to execute. Enter the sales tax rate (e.g., 0.08), select the range of prices you wish to process, then specify the target result column (such as "B"). The macro will automatically fill in the sales tax results next to your price data.
This method helps reduce repetitive manual calculation, ensuring accuracy and saving time. If you encounter any errors, confirm you have the correct permissions for running macros and that inputs are formatted properly.
Related articles:
Best Office Productivity Tools
Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time. Click Here to Get The Feature You Need The Most...
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
- Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
- Open and create multiple documents in new tabs of the same window, rather than in new windows.
- Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
All Kutools add-ins. One installer
Kutools for Office suite bundles add-ins for Excel, Word, Outlook & PowerPoint plus Office Tab Pro, which is ideal for teams working across Office apps.





- All-in-one suite — Excel, Word, Outlook & PowerPoint add-ins + Office Tab Pro
- One installer, one license — set up in minutes (MSI-ready)
- Works better together — streamlined productivity across Office apps
- 30-day full-featured trial — no registration, no credit card
- Best value — save vs buying individual add-in