# How do I solve for n (number of periods) in a loan repayment formula?

Where

• A = payment Amount per period
• P = initial Principal (loan amount)
• r = interest rate per period
• n = total number of payments or periods

How can I rearrange the formula to solve for n?

• Have you tried logarithms? – SK19 Apr 13 '19 at 6:26

$$A = P \frac{r(1+r)^n}{(1+r)^n -1} \Rightarrow$$
$$A [(1+r)^n -1]= rP (1+r)^n \Rightarrow$$
$$(A-rP)(1+r)^n = A \Rightarrow$$
$$(1+r)^n = \frac{A}{A-rP}\Rightarrow$$
$$n = \log_{1+r} (\frac{A}{A-rP})$$
• @CalebMacdonaldBlack Step1: multiply left and right by $(1+r)^n -1$; step2: bring things from the right to the left and then bring the $-A$ to the right; step3: divide left and right by $A-rP$; step4: take the logarithm on left and right; where do you want an explanation? – dcolazin Apr 13 '19 at 7:15