Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 388105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T15:44:15+00:00 2026-05-12T15:44:15+00:00

How to calculate the monthly fee on a loan? Given is: a: an amount

  • 0

How to calculate the monthly fee on a loan?

Given is:

  • a: an amount to loan.
  • b: the loan period (number of months).
  • c: the interest rate p.a. (interests is calculated and added every month, 1/12 of the interest is added. So if the interest is on 12%, 1% interest is added every month).
  • d: the amount of money owed after the end of the period.

This problem is a bit different than the usual since, the goal is not to have the loan payed after the loan period has ended, but to still owe an amount that is given. I have been able to find an algorithm so solve the problem if I wanted to pay the entire amount, but it will of course not work for this problem where the goal is to end up owing a given amount rather than not owing anything.

I managed to make a solution to this problem by starting with an guess and then keep on improving that guess until it was close enough. I wondered however, if there is a better way to simply calculate this, rather than just guessing.

Edit: Here’s how I’m doing it now.

def find_payment(start, end, months, interest):
    difference = start
    guess = int(start / months * interest)
    while True:
        total = start
        for month in range(1, months + 1):
            ascribe = total * interest / 12
            total = total + ascribe - guess
        difference = total - end
        # See if the guess was good enough.
        if abs(difference) > start * 0.001:
            if difference < 0:
                if abs(difference) < guess:
                    print "payment is %s" % guess
                    return evolution(start, guess, interest, months)
                else:
                    mod = int(abs(difference) / start * guess)
                    if mod == 0:
                        mod = 1
                    guess -= mod
            else:
                mod = int(difference / start * guess)
                if mod == 0:
                    mod = 1
                guess += mod
        else:
            print "payment is %s" % guess
            return evolution(start, guess, interest, months)

evolution is just a function that displays how the loan would look like payment for payment and interest for interest, summing up total amount of interest paid etc.

An example would be if I wanted to find out the monthly payments for a loan starting with $100k and ending at $50k with an interest of 8% and a duration of 70 months, calling

>>> find_payment(100000, 50000, 70, 0.08)
payment is 1363

In the above case I would end up owing 49935, and I went through the loop 5 times. The amount of times needed to go through the loop depends on how close I want to get to the amount and it varies a bit.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T15:44:16+00:00Added an answer on May 12, 2026 at 3:44 pm

    This is a basically a mortgage repayment calculation.

    Assuming that start is greater than end, and that interest is between 0 and 1 (i.e. 0.1 for 10% interest)

    First consider the part of the payment you want to pay off.

    Principal = start - end
    

    The monthly payment is given by:

    pay_a = (interest / 12) / (1 - (1+interest/12) ^ (-months))) * Principal
    

    You then need to consider the extra interest. Which is just equal to the remaining principal times the monthly interest

    pay_b = interest / 12 * end
    

    So the total payment is

    payment = (interest / 12) * (1 / (1 - (1+interest/12) ^ (-months))) * Principal + end)
    

    On the example you gave of

    Start: 100000
    End:  50000
    Months: 70
    Interest: 8% 
    pay_a = 896.20
    pay_b = 333.33
    Payment = 1229.54
    

    When I tested these values in Excel, after 70 payments the remaing loan was 50,000. This is assuming you pay the interest on the notional before the payment is made each month.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey I am trying to calculate monthly repayments based on loan amount, interest rate
I am using the following R script to calculate a monthly CpK number: mydf
I'm trying to calculate various time period returns (monthly, quarterly, yearly etc.) for each
I am currently trying to calculate a monthly payment plan in C# given a
I am trying to calculate number of users, cumulatively for the dellstore2 database. Looking
Could you help to calculate the number of each variable where each variable =1?
How can I calculate the date having only the week number and day of
I'm trying to calculate the monthly payment for the following scenario: $5,000 is borrowed
I am trying to calculate the annual total of monthly product(binary files) https://echange-fichiers.inra.fr/get?k=Jr3tvgeKnWUiC1B0MMY .
I am trying to calculate the annual total of monthly product(binary files) https://echange-fichiers.inra.fr/get?k=Jr3tvgeKnWUiC1B0MMY .

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.