I have a base value of 100 and I apply a +10% and a + 7% increase to it. To get the calculated value, I do:
100 * 1.1 = 110
110 * 1.07 = 107
100 + 10 + 7 = 117
Now, to get back to 117, I was initially doing:
117 / 1.1 = 106.363636363636
106.363636363636 / 1.07 = 99.4052676295664 which is obviously not the original value of 100.
I then realized that I needed to apply the calculations in reverse order in which they were applied to get back to the original value, so:
117 / 1.07 = 110
110 / 1.1 = 100
Is there a way to do it so I get back to my original value (100 in this case) from 117 by going in the same order I used to get to 117 (that is, applying 10% first and then 7%
Here is a more detailed example which I calculated already and it appears to be correct, but I just want to make sure, so here is the setup:
My base value is 100 and I have a +10% and +7% compounded percentages and I have a +5% and +3% non-compounded perntages, so to first get my adjusted value, I do:
I have a variable adjustedValue which I will use to store the variables along the way, it is intially set to the total (100).
adjustedTotal = adjustedTotal * 1.1 = 110
adjustedTotal = adjustedTotal * 1.07 = 117.7
adjustedTotal = adjustedTotal + (value * 0.05) = 117.7 + 5 = 122.7
adjustedTotal = adjustedTotal + (value * 0.03) = 122.7 + 3 = 125.7
To get back to 100 from 125.7, I do:
adjustedTotal = adjustedTotal - (value * 0.03) = 125.7 - 3 = 122.7
adjustedTotal = adjustedTotal - (value * 0.05) = 122.7 + 5 = 117.7
adjustedTotal = adjustedTotal / 1.07 = 110
adjustedTotal = adjustedTotal / 1.1 = 100
Is the above the correct way to approach it?
The example below uses a base of 1000 and 3 rates (10%, 5%, and 3%).
If 10%, 5%, and 3% are compounded and they are all added to the base, I do:
1000 * 1.1 * 1.05 * 1.03 = 1189.65
To get back to 1000 from 1189.65, I do:
1189.65 / 1.1 / 1.05 / 1.03
If 10%, 5%, and 3% are non-compounded and they are all added to the base, I do:
1000 * (1 + 0.1 + 0.05 + 0.03) = 1180
To get back to 1000 from 1180, I do:
1180 / (1 + 0.1 + 0.05 + 0.03)
All of the above is well and works fine, the problem is when I need to mix and add rates, for example:
Assume I stick with my base of 1000, but my rates are all non-compounded and they are added and subtracted, hence(+10%, -5%, +3%). I know I can do this:
1000 * (1 + 0.1 - 0.05 + 0.03) = 1080 and to get back I do:
1080 / (1 + 0.1 - 0.05 + 0.03) = 1000
In the above, the confusing part to me is that no matter if I go up or down with the rates, will I always use division, basically, will I always do:
1080 / (1 + 0.1 - 0.05 + 0.03) and just change the signs in the parentheses. Here is an example:
1000 * (1 - 0.1 - 0.05 - 0.03) = 820
820 / (1 - 0.1 - 0.05 - 0.03) = 1000
In the above, will it always be 820 / ... when going backwards or will it ever be 820 * ...