# How do you work out a formula when some of the inputs depend on the output?

I'm working on a loan calculator and I have an issue with some inputs.

I have altered the formula so that I can now work out principal, number of payments and payment amount based on the normal amortization formula and given the other two inputs plus APR.

My issue is that the APR is a function of principal and number of payments so if I'm working out the principal or number of repayments I am missing a variable

It's a long time since I've done any maths so apologies if this is a very simple question, I can't seem to work out how to get around this issue and I seems to recall something in leaving cert maths that covered the situation. Can anyone help me out?

sample for monthly payment :

$$\text{monthlypayment} = \frac{\text{principal} \times \text{paymentpercentage}}{1- (1 + \text{paymentpercentage})^{\text{numberpayments} - 1}}$$

paymentpercentage depends on the principal and number of payments ( example 1% if 48 payments and 10000 principal, 1.2% if 60 payments and 10000 principal)

• Please provide the formulas you want to use to compute something, else we (as in most around here) won't be able to tell what you even want. – AlexR Nov 13 '14 at 16:47
• is there a formular to calculate paymentpercentage, assume that you've already known the principal and the number of payments? If there is, a simple substitution is all needed. – user49685 Nov 13 '14 at 17:03
• The problem is that the formula relies on the principal and number of payments and the two formulae I'm having issues with are getting the number of payments and the principal given monthly repayment – LiamRyan Nov 13 '14 at 17:05