TITLE: Adding and Removing Non-Compounded Percentages does not produce the same result?
QUESTION [7 upvotes]: If I take the value 100 and I want to and 10% tax to it and then a 7% tax to it, I am doing the following:
$$\begin{align*}
100 \times \left(1 + \frac{10}{100}\right) &= 110\\
100 \times \left(1 + \frac{7}{100}\right) &= 107\\
100 + 10 + 7 &= 117.
\end{align*}$$
If I remove 10% and then 7% from 117, I do not get 100, I get 98.7094.... My formula is setup like this:
GrandTotal = 117
AjustedTotal = GrandTotal
Value = GrandTotal - (GrandTotal/(1 + (percent/100))
AdjustedTotal = AdjustedTotal - Value
If I am doing more than 1 percentage, I run into problems such as 10% and 7%.
Am I overdoing this and what am I doing wrong.  Basically, I want to take a value and add taxes to it and then remove the same taxes to retrieve my original value.
I added a question about this on stackoverflow here, but I am stuck at programming the non-compounding part and the mixture of both.

REPLY [5 votes]: Let's take a simpler example first.  If you increase 400 by 25% you get 500.  If you reduce 500 by 25% you get 375.  With equations this is 
$$400 \times (1+ 0.25) = 500$$
$$500 \times (1- 0.25) = 375$$
so it is clear that this multiplication does not work, and we should not expect it to since $(1+ 0.25) \times (1- 0.25) = 0.9375$ not $1$.  So to undo the increase (from 400 to 500), instead we should divide as follows:
$$500 \div (1+ 0.25) = 400$$
and since $1 \div (1+ 0.25) = (1 - 0.20) $, we would have 
$$500 \times (1 - 0.20) = 400$$
so a 25% increase must be undone by a 20% decrease.  You seem to understand this in your equation for value.
The second issue is your lack of compounding the taxes.  If you did compound then it is correct that $$100 \times (1 + 0.10) \times (1 + 0.07) = 117.70$$
and you would undo it with $$117.70 \div (1 + 0.10) \div (1 + 0.07) = 100$$
but that does not work here.
So instead you start with 
$$100 \times (1 +0.10 + 0.07) = 117$$ 
and to undo it you do 
$$117 \div (1 +0.10 + 0.07) = 100$$

REPLY [2 votes]: Essentially, you've computed your after-tax value using the formula
$$\array{T &=& P + (0.10)P + (0.07)P\\&=& (1.17)P}$$
where T is the after-tax price, and P is the before-tax price.
If you want to get back to P from T, just solve for P in the above equation to get
$$P = \frac{T}{1.17}$$