# What is the formula for add/removing compound and non-compound tax from a value?

I had posted this question on stack overflow because I am trying to implement a method that will loop through a set of percentages and add or remove them to a value based on some properties that are set. Here is a link to the question. I believe I have the compounding part correct. I partially have the non-compounding part, the problem is that I need to add just 1 to the very end instead of every time through the loop. The other issue I am facing is how do I mix compounding and non-compounding in the formula. Basically, I have the following scenarios:

All percentages are compounded and removed from the total.
All percentages are non-compounded and removed from the total.
All percentages are compounded and added to the total.
All percentages are non-compounded and added to the total.
All percentages are compounded, but some are removed and some are added.
All percentages are non-compounded, but some are removed and some are added.
Some percentages are compounded and some are non-compounded, but they are all added.
Some percentages are compounded and some are non-compounded, but they are all removed.
Some percentages are compounded and some are non-compounded, and they could be removed or added.

I believe I covered everything.

Thanks for the help

-
add comment

## 1 Answer

What base are the non-compounded ones taken on? For example, assume a 100 base price, a +3% and -6% compounded, a +10% and -8% non-compounded tax. If the non-compounded taxes are on the base you just get $100\cdot1.03\cdot0.94+100\cdot0.10-100\cdot0.08=100(1.03\cdot0.94+0.10-0.08)$ for a final price or $100(1.03\cdot0.94+0.10-0.08)-100$ for the total tax. Is this what you are after?

-
If I understand your answer correctly, I believe what I want to do is take the compounded tax on the new base that is calculated from the previous tax. –  Xaisoft Apr 14 '11 at 19:38
Yes, that is the meaning of compounded. The total tax won't change with the order you apply them, but how much each tax is will do so. –  Ross Millikan Apr 14 '11 at 20:01
I did your example in a calculator, what is supposed to be the correct result. –  Xaisoft Apr 14 '11 at 20:07
I just made it up on the fly, but I get 98.82 for the final price, or a tax of -1.18 –  Ross Millikan Apr 14 '11 at 20:39
add comment