How to calculate the original value given a percentage inclusive value?
Asked Answered
H

4

8

We have a shopping cart that is used in different places, therefore the tax is stored in a config file, presently in New Zealand it is 15%, so in the config file we are storing .15 but this number can be changed, so I need to formulas to not rely on this value being a specifc value!

We also have another key that stores whether the prices we are storing are tax inclusive or exclusive (users are picky, some want to enter prices with, some without :/).

So, if the key contains inclusive it means that the prices are stored containing the gst content as well.

if the key contains exclusive, well. you get the idea.

Anyway.

I am having a wee bit of an issue wrapping my head around the formulas to get the tax inclusive and exclusive prices.

Let's use these variables.

$tax_type = 'exclusive'
$product_price = 150
$tax_amount = 0.15

If a product has it's price stored tax exclusive thats easy.

Exclusive price = $product_price = 150
Inclusive price = $product_price + ($product_price*$tax_amount) = 150 + (150*0.15)

But if a product has it's price stored tax inclusive that's where I get confused.

So, the variables now become

$tax_type = 'inclusive'
$product_price = 172.5
$tax_amount = 0.15

The tax inclusive price is now $product_price. But how do I calculate the tax exclusive price?

On the IRD website, it states you can use $product_price - ($product_price*3/23) but I imagine that is only for tax at 15%?

Harebell answered 3/4, 2013 at 0:49 Comment(0)
Z
20

The formula is straight forward:

Inclusive = Exclusive * (1 + tax rate)

Where the tax rate is some decimal such as the 0.15 you posted. Via algebra then, the exclusive price would be:

Exclusive = Inclusive / (1 + tax rate)

Zealand answered 3/4, 2013 at 0:57 Comment(1)
You just saved me from dusting off 40 year old algebra skills!Reahard
L
3

I know its an old question, but some how it may useful for others.

Suppose the item price is 20.00 (inclusive of tax)

Tax rate is 14.5

we need to calculate exclusive price the formula is as follows.

tax excluded price  = item price / ((tax rate /100) + 1 )

eg: 20 / ((14.5/100) + 1)) = 17.4672489.

The detailed documentation can be found here for calculating tax inclusive and exclusive in billing applications

hope it helps others.

Lingenfelter answered 15/2, 2016 at 8:27 Comment(0)
C
2

If you want the tax portion of an inclusive amount, below is a simpler equation that skips having to workout the exclusive figure then subtracting it:

tax = amount * (rate / (100 + rate))

E.g. 15% GST - Item sold for $92.00

Tax = $92.00 * (15 / 115) = $12.00

Coom answered 17/5, 2016 at 22:21 Comment(0)
D
1

To add 15% GST:

  • Inclusive = Exclusive x 115%

To subtract 15% GST:

  • Exclusive = Inclusive / 115%

Additionally, these formulas:

  • Are compatible with Excel, e.g. =A1*115% or =A1/115%
  • Can be used in calculators (Window, phones, Google, etc.), e.g.: inclusive ÷ 115%
  • For programming languages, 115% can be expressed as (115/100), then in Chrome's console for instance is: exclusive * (115/100) or inclusive / (115/100)
Discommon answered 7/4 at 12:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.