Amortization Calculator for Excel

Amortization Calculator for Excel

Use this calculator to determine the amortization schedule for your loan or mortgage.

Monthly Quarterly Annually
function calculateAmortization() { let loanAmount = parseFloat(document.getElementById(“loanAmount”).value); let interestRate = parseFloat(document.getElementById(“interestRate”).value) / 100; let loanTerm = parseInt(document.getElementById(“loanTerm”).value); let paymentFrequency = document.getElementById(“paymentFrequency”).value; if (isNaN(loanAmount) || isNaN(interestRate) || isNaN(loanTerm) || loanAmount <= 0 || interestRate <= 0 || loanTerm <= 0) { alert("Please enter valid positive values for all fields."); return; } let paymentsPerYear = paymentFrequency === "monthly" ? 12 : paymentFrequency === "quarterly" ? 4 : 1; let numberOfPayments = loanTerm * paymentsPerYear; let monthlyInterestRate = interestRate / paymentsPerYear; let monthlyPayment = loanAmount * (monthlyInterestRate * Math.pow(1 + monthlyInterestRate, numberOfPayments)) / (Math.pow(1 + monthlyInterestRate, numberOfPayments) – 1); let resultHTML = `

Amortization Schedule

`; let remainingBalance = loanAmount; for (let i = 1; i <= numberOfPayments; i++) { let interestPaid = remainingBalance * monthlyInterestRate; let principalPaid = monthlyPayment – interestPaid; remainingBalance -= principalPaid; resultHTML += ``; } resultHTML += “
Payment #Payment AmountPrincipal PaidInterest PaidRemaining Balance
${i} $${monthlyPayment.toFixed(2)} $${principalPaid.toFixed(2)} $${interestPaid.toFixed(2)} $${remainingBalance.toFixed(2)}
“; document.getElementById(“amortizationResult”).innerHTML = resultHTML; }

Leave a Reply

Your email address will not be published. Required fields are marked *