I'm trying to reverse engineer a formula to find answers without trial and error.

559 Views Asked by At

As an example, I need to pay €100 to this business, and there are 2 separate fees I need to also pay, the fee for the payment processor and the VAT (Value Added Tax).

I know that the fee for the payment processor is 2.4% + .24c and that the VAT is 23% which is only charged on the processor's fee. I also have found out that what I need to pay is €103.35 to reach my goal of €100, but I'm hoping that there is a formula to make this process simpler than guessing, getting it wrong, and trying again.

Basically, I want to plug the amount that I need to pay the business into a formula to find the total that I need to pay to cover the fee and tax as well.

I have a formula (sort of) to calculate how much of my payment will be remaining after fee and VAT: C = Payment F = Processor Fee V = VAT € = Remaining after fee and VAT

(C * 0.024) - 0.24 = F

F * 0.23 = V

C - (F + V) = €

I appreciate the help!

3

There are 3 best solutions below

4
On BEST ANSWER

Suppose you need to pay a net of $N$ to the business. Let the actual amount you give be $A$. We know $N$ and want to find $A$.

The processing fee is $(0.024)A +0.24$. In addition, VAT has to be paid on that, an amount equal to $(0.23)\left[(0.024)A+0.24\right]$.

So the total lost from $A$ to fee and VAT is $(1.23)\left[(0.024)A+0.24\right]$. It follows that $$N=A-(1.23)\left[(0.024)A+0.24\right].\tag{1}$$ We want to solve for $A$ in terms of $N$. Expand the right-hand side of (1). We get $$N=(1-(1.23)(0.024))A-(1.23)(0.24).$$ Solving for $A$, we get $$A=\frac{N+(1.23)(0.24)}{1-(1.23)(0.024)}.\tag{2}$$

For $N=100$, this calculates to $103.34597$. But probably we would round this correct to $2$ decimal places.

I could have used letters for the fee components and the VAT rate to make the formula general. However, how to modify for changing fees and VAT should be clear from the derivation and structure of Formula (2).

0
On

Well you were almost there. Suppose you pay $x$, then $$0.024x+0.24$$ is removed for payment processor, and then $$(0.024x+0.24)\cdot 0.23$$ is removed as vat. You noted correctly that you are left with

$$x-(0.024x+0.24)-0.23\cdot (0.024x+0.24)=y$$

Now we just need to solve for $x$, hence we get some ugly numbers:

$$x-0.024x-0.24-0.00552x-0.0552=y$$ $$0.97048x-0.2952=y$$ Now switching sides $$x=\frac{y}{0.97048}+\frac{0.2592}{0.97048}$$ For which our trusty friend google gives us the answer: $$x=1.03041793752y+0.2670843294$$

Now for sanity checking suppose I want to pay 100\$, then by our formula I need to pay $1.03041793752\cdot100+0.2670843294\approx103.042+0.267=103.309$

Putting this back into the original equation we see that the processor fee is about $2.719$ and the vat is about $0.625$ so in total we get $3.34488168$ and $103.309-3.334\approx100$

Of course for exact amounts you need to not round the numbers

0
On

I think I see what you're getting at: You're going to write a check for an amount $C$. The payment processor is going to siphon off $2.4\%$ of $C$ plus $0.24$ cents, or $.024C+.24$. The government is going to siphon off another $23\%$ of what the payment processor takes, or $.23(.024C+.24)$. This leaves $C-(.024C+.24)-.23(.024C+.24)$ to pay the business, which you owe $100$ euros.

In general, the payment processor takes a fraction $p$ and a fixed amount $f$, and the VAT takes a fraction $r$ of the payment processor's fee (not from the processor, but from you!). So the total amount removed from your check $C$ is $(pC+f)+r(pC+f)=(1+r)(pC+f)$. If the amount you owe is $A$, your check $C$ must satisfy

$$C-(1+r)(pC+f)=A$$

Solving for $C$ gives

$$C={A+(1+r)f\over1-(1+r)p}$$

In the current case, $A=100$, $r=.23$, $f=.24$, and $p=.024$, which gives

$$C={100+1.23\cdot.24\over1-1.23\cdot.024}\approx103.34597\approx103.35$$

as you found.