codelearner
codelearner

Reputation: 1365

Reverse percentage to get actual amount

I ran into scenario where my client wants to know the original amount after percentage deduction. They are collecting online donation where user enter its amount and then percentage values (bank charges and FED) are added in his amount to ensure that my client always get exact amount in his account after percentage deduction.

For example:

Donation amount = 32,000
Bank charges = 3%
FED charges = 13%

Calculation: 

Deducting bank charges = 32000 * .03 = 960
Deducting FED on bank charges = 960 * .13 = 124.80
Total = 32000 + 960 + 124.80 = 33,084.80

I now want to reverse the amount 33,084.80 to get the exact actual amount of 32,000.

Upvotes: 0

Views: 53

Answers (1)

MBo
MBo

Reputation: 80197

Let Bank charges = b, FED charges = f (here b=0.03, f=0.13)

Then

  Donation  + Donation * b + Donation * b * f = Total
  Donation * (1 + b + b * f) = Total
so
  Donation = Total / (1 + b + b * f)
here
  Donation = 33,084.80 / (1 + 0.03 + 0.03 * 0.13) = 33,084.80 / 1.0339 = 32,000

Upvotes: 2

Related Questions