Create an Automated Loan Repayment Schedule in Excel Power Query
Question details
Create a loan repayment schedule that calculates each month's balances, interest, and principal automatically.

- Product
- Microsoft Excel Power Query
- Device & OS
- not provided
- Scenario
- A loan has a fixed monthly payment and annual interest rate, and the user wants a schedule for the full year.
- Observed behavior
- Each month's closing balance should become the next month's opening balance, with interest and principal recalculated sequentially.
Gather the starting loan balance, fixed monthly payment, and annual interest rate. Enter the rate as a decimal in Power Query, such as 0.08 for 8%, and confirm that monthly interest is calculated at one-twelfth of the annual rate.
Generate a 12-month schedule with Power Query
Use a blank query to calculate each month from the preceding month's closing balance.
The query uses List.Accumulate to build the rows sequentially. The sample values are illustrative; replace them with your loan details.
In Excel, select Data > Get Data > From Other Sources > Blank Query. In the Power Query Editor, select Home > Advanced Editor.
Replace the existing code with the following, then select Done: let InitialBalance = 100000, MonthlyPayment = 4500, AnnualRate = 0.08, Rows = List.Accumulate( {1..12}, {}, (state, month) => let opening = if List.IsEmpty(state) then InitialBalance else List.Last(state)[Closing Balance], interest = opening * AnnualRate / 12, principal = MonthlyPayment - interest, closing = opening - principal in state & {[Month = month, Opening Balance = opening, Payment = MonthlyPayment, Annual Rate = AnnualRate, Interest = interest, Principal = principal, Closing Balance = closing]} ), Schedule = Table.FromRecords(Rows) in Schedule
In Home > Advanced Editor, replace InitialBalance, MonthlyPayment, and AnnualRate with your values. Change {1..12} if you need a different number of monthly rows.
Select Home > Close & Load to place the schedule in Excel. To change the inputs later, edit the query and load it again.

Build the schedule with Excel worksheet formulas
Use worksheet formulas instead if you want to change inputs directly in cells without editing a query.
Build a loan schedule with WPS Spreadsheets
WPS Office is a free, lightweight alternative for working with loan schedules in a familiar spreadsheet interface. Open an Excel workbook and use cell formulas to calculate monthly interest, principal, and balances.

Frequently Asked Questions
How is monthly interest calculated in the schedule?
Multiply the opening balance by the annual rate and divide by 12. For example, with an 8% annual rate, use Opening Balance × 0.08 / 12.
How does the next month get its opening balance?
In the Power Query example, List.Last(state)[Closing Balance] retrieves the previous row's closing balance. In the worksheet alternative, cell B8 refers to F7, and the reference advances when you fill the formula down.
Why does my closing balance become negative?
The fixed payment may exceed the remaining balance plus interest. The examples do not cap the final payment, so review and adjust that payment when the loan is paid off.
Can I create a schedule longer than one year?
Yes. In Power Query's Home > Advanced Editor, change {1..12} to the number of months you need, such as {1..24} for two years.
What happens if the payment is smaller than the monthly interest?
The principal calculation becomes negative, so the closing balance increases. Check the payment and interest rate inputs before relying on the schedule.




