https://accounting-simplified.com/financial/payables/loan.html assume each month has a different interest rate. dont assume you can calculate this at the end of the month only