Financial Math - Calculate Loan Payment w/ Compounding Interest

44 Views Asked by At

I have recently been attempting to create an amortization schedule program. I have failed multiple times at this point so I am starting back at square one, Payment Amount.

To begin calculating my payment let first get some information about the loan.

Payment Schedule: Monthly

Principal Amount: $25000.00

Annual Rate: 0.0385 / 3.85%

Term Length: 48

Term Unit: Months

Compounding Frequency: possible = [continuous, ..., Yearly]

Year Base: possible = [365/365, 30/360, 365/360]

I would like to be able to calculate the payment amount with or without a compounding frequency or year base being specified

Now I need to calculate the number of terms for a year along with the total number of terms.

Payment Schedule = Monthly -> Terms per Year = 12

Payment Schedule = Monthly & Term Unit = Months -> Total Terms = 48

Easy enough, now we need to calculate the Term Rate.

Term Rate = (Annual Rate / Year Terms) = (0.0385 / 12) = ~0.00320833333

Because this is a program I will not be rounding any of my answers until they are ready to be displayed.

Now we should be ready to calculate payment. Below is the formula to calculate the payment without compounding interest

Payment = (Term Rate * Principal) / (1 - [(1 + Term Rate)^(-Total Terms)])

For my values my payment comes out to: $562.80

When I have checked this using other payment calculators it seems to be correct. What I am wanting to know is if I am calculating it correctly and if not, how should I be calculating it? Also, I am needing to know how to calculate my payment with compounding freq. given.

EDIT

I will need to use a different formula IF there is compounding interest. I need to know this formula.