Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Financial Calculation (Interest Rate given Amt Financed, Months, FinanceCharge)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Re: Financial Calculation (Interest Rate given Amt Financed, Months, FinanceCharge)

    Thanks Robin... but the XL example calculates the Payment and amount for interest (financeCharge)...
    ... what I need is to calculate the percent, given the correct parameters...
    The key to my confusion here is the definition of 'correct parameters'

    I think that my problem is that the calculated payment amount, Payment(), includes the payments for interest as well as principle. The payment amount, Payment(), is a function of FinancedAmount, FinanceRate, and the Term of the loan.
    So... when the salesperson agrees to values of FinancedAmount, FinanceCost, Term, and MinimumMonthlyPayment an unsolvable problem arises because the FinaceCost will be determined by the Term and MinimumMonthlyPayment i.e. it cannot be arbitrarily agreed to independent of Term, and MinimumMonthlyPayment.

    So... correct me if I'm wrong, the 'solution' must involve strict business rules that involve a renegotiation of the contract if the salesperson enters incorrect data on the sales agreement.
    As Ray Lyons said in an earlier post in this chain...
    "Finally, I would love to be wrong, i.e., that someone out there has a simple mathematical formula that will produce a 100% right APR answer."

    Comment


      #17
      Re: Financial Calculation (Interest Rate given Amt Financed, Months, FinanceCharge)

      Below is the function that I now believe (hope) will return a value for the % of the loan given the FinancedAmt (Principle), The Term (months) and the Required MinimumMonthly Payment:

      FUNCTION FinancePercent AS N (FinancedAmt As N, Months As N, MinMonPay As N )
      dim CalcPayment As N
      dim NextGuess As N
      dim PaymentAt2Percent As N
      dim PaymentAt50Percent As N
      dim CostOfBorrowing As C

      ui_msg_box("REMEMBER... There is only a narrow range of valid MinMonPay","REMEMBER... There is only a narrow range of valid MinMonPay that will satisfy values for Financed Amount & Term",UI_INFORMATION_SYMBOL+UI_OK)

      PaymentAt2Percent = payment(FinancedAmt,.02/12,Months)
      if PaymentAt2Percent > MinMonPay then
      Response = ui_msg_box("Payment at 2% is > MinMonPay Entered","Payment at 2% is > MinMonPay Entered... DO NOT CONTINUE",UI_INFORMATION_SYMBOL+UI_OK_CANCEL)
      if Response = UI_CANCEL_SELECTED then
      end
      end if
      end if

      PaymentAt50Percent = payment(FinancedAmt,.5/12,Months)
      if PaymentAt50Percent < MinMonPay then
      Response = ui_msg_box("Payment at 50% is still < MinMonPay Entered","Payment at 50% is still < MinMonPay Entered... DO NOT CONTINUE",UI_INFORMATION_SYMBOL+UI_OK_CANCEL)
      if Response = UI_CANCEL_SELECTED then
      end
      end if
      end if

      Response = ui_msg_box("MinMonPay At 2% = " + alltrim(str(PaymentAt2Percent,18,2)) + " MinMonPay At 50 % = " + alltrim(str(PaymentAt50Percent,18,2)),"MinMonPay At 2% = " + alltrim(str(PaymentAt2Percent,18,2))+ " MinMonPay At 50 % = " + alltrim(str(PaymentAt50Percent,18,2)),UI_INFORMATION_SYMBOL+UI_OK_CANCEL)
      if Response = UI_CANCEL_SELECTED then
      end
      end if

      CalcPayment = 1
      NextGuess = .01/12 '(ie 1%... the function uses the RATE/12, if the rate is per year... it doesn't use the % value)
      'ui_msg_box("NextGuess = " + alltrim(str(NextGuess,18,4)),"NextGuess = " + alltrim(str(NextGuess,18,4)) + " TotalFinanced = " + alltrim(str(TotalFinanced)),UI_INFORMATION_SYMBOL+UI_OK)
      'ui_msg_box("Months = " + alltrim(str(Months,18,4)),"Months = " + alltrim(str(Months,18,4)) + " MinMonPay = " + alltrim(str(MinMonPay)),UI_INFORMATION_SYMBOL+UI_OK)
      'end
      DIM GLOBAL pDlg1 as waitdialog
      pDlg1.Set_Title("Please Wait")
      pDlg1.Create(1,"Repeating")
      pDlg1.Set_Message("Calculating Finance %...")
      pDlg1.Set_Bottom_Message("")
      while CalcPayment < MinMonPay
      CalcPayment = Payment( FinancedAmt, NextGuess, Months )
      'ui_msg_box("CalcPay = " + alltrim(str(CalcPayment)) + " Rate = " + alltrim(str(NextGuess,18,4)),"CalcPay = " + alltrim(str(CalcPayment)) + " Rate = " + alltrim(str(NextGuess,18,4)),UI_INFORMATION_SYMBOL+UI_OK)
      NextGuess = NextGuess + 0.0000001
      end while
      pDlg1.Close()
      CostOfBorrowing = alltrim(str(CalcPayment*Months-FinancedAmt,18,2))
      ui_msg_box("COST OF BORROWING = " + CostOfBorrowing ,"COST OF BORROWING = " + CostOfBorrowing,UI_ATTENTION_SYMBOL+UI_OK)
      FinancePercent = round(NextGuess * 1200,2)

      END FUNCTION

      If anyone can see serious problems with this please let me know.
      Thanks!

      Comment


        #18
        Re: Financial Calculation (Interest Rate given Amt Financed, Months, FinanceCharge)

        "Finally, I would love to be wrong, i.e., that someone out there has a simple mathematical formula that will produce a 100% right APR answer."
        I gave you a roll method above that will get you the apr in post #8. - did you try that??
        It takes the amount financed and amount of interest and term to get the apr.
        There is no way to calculate what yuou are asking 100% without knowing absolutely all of it.
        Any financial wizard will tell you that a payment is only an answer based on other.

        Your payment derived by salesmen is based on total of loan which is principal + interest without knowing the apr(annual percentage rate) so the one I gave you will give you that.

        function - Payment() bases on yearly like 3 is 3 years so you have to divide by 12. the interest is expecting a decimal, but the real world is looking for something like 22.80% apr so it has to be modified a bit to get the accepted number. extending for a wrong calculation by a salesman in division of payment terms can cause the calculation to be wrong.
        Comes in why I wrote my on payment on apr function where days to first is taken into account and where odd months like 69 is accepted and properly calculated.
        example: If you need payments to start on the first of next month and you are 15 days away, that is about 1/2 month extra interest. Causes apr to change.

        But any ways - Good Luck.
        Last edited by DaveM; 04-18-2016, 11:23 AM.
        Dave Mason
        [email protected]
        Skype is dave.mason46

        Comment


          #19
          Re: Financial Calculation (Interest Rate given Amt Financed, Months, FinanceCharge)

          Thanks Dave

          Dave
          Sadly... I am not ever going to be a 'Financial Wizard' but... I now realize that the FinanceCharge is DETERMINED by the term and the required minimum monthly payment... it cannot be arbitrarily entered along with term and minimum monthly payment (for a given FinancedAmount; if the salesperson wants a specific FinanceCharge then the term must change or the minimum monthly payment must change, or both) .

          Re: your 'roll method'
          I did look at your suggestion and I thought that the code I presented today at 9:26 AM incorporated the idea that you illustrated... am I missing something?

          Thanks

          Comment


            #20
            Re: Financial Calculation (Interest Rate given Amt Financed, Months, FinanceCharge)

            Not sure if you are or not.
            run both and see if the answers are the same?

            if your salesman adds the finamnt and fincharge together and divides by 24 or 36 to get a payment, he should do fine. If he divides by a payment, it is much more complicated. Also, if he lets the wait 40(+-) days to start, it is more complicated.
            Last edited by DaveM; 04-18-2016, 12:14 PM.
            Dave Mason
            [email protected]
            Skype is dave.mason46

            Comment


              #21
              Re: Financial Calculation (Interest Rate given Amt Financed, Months, FinanceCharge)

              Ok, tried out the function with a small change to return 4 decimals instead of 2 and it returned 23.9277 which seems pretty accurate to me!
              Last edited by MoGrace; 04-19-2016, 10:59 AM.
              Robin

              Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

              Comment


                #22
                Re: Financial Calculation (Interest Rate given Amt Financed, Months, FinanceCharge)

                Hi Robin,

                It is accurate for loans with first payment starting the same day, but will vary with days to first affecting it(if they are there).
                Dave Mason
                [email protected]
                Skype is dave.mason46

                Comment


                  #23
                  Re: Financial Calculation (Interest Rate given Amt Financed, Months, FinanceCharge)

                  The rate would also change if using a 365 day year instead of 360 which apparently the payment() function uses. Rule of 78's didn't change the total interest paid, only the monthly amortized amount. Then there is whether the interest is to be calculated in advance or in arrears (normal) which also only changes the monthly interest and not the total interest.

                  I think he needs to find an ActiveX control... ;) But for what he is doing his function is probably sufficient.
                  Robin

                  Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

                  Comment


                    #24
                    Re: Financial Calculation (Interest Rate given Amt Financed, Months, FinanceCharge)

                    I think he needs to find an ActiveX control... ;) But for what he is doing his function is probably sufficient
                    ActiveX is not needed, but you are correct. what he is doing is sufficient for his purpose. Will it stand any kind of scrutiny? NO!
                    Federal and state would issue a desist order for any tool used to derive that he is using and an order to comply to standards. He is in Canada and I do not know what regulations they have.
                    Understand, they don't care the method used to derive payment as long as it does not exceed legal rates, but if you state a rate, it has to be absolutely accurate within rounding rules.

                    This function would replace the alpha payment function and has been tested in all 50 states to be within rounding for car loans. It is accurate for other loans as well, but some types use completely different calculations.

                    Code:
                    FUNCTION pmtonapr AS N (p as n, r as n, mos as n, type as n, daystofirst as n)
                    'Description:p=loan amount,R=rate as 7.0, mos = monthly term, type = type of term, daystofirst=how many days to first payment due
                    if r <= 0.00 then
                        pmtonapr = p/mos
                    else
                    dim df as n
                    dim rte as n = (r/100)/12
                    df = round_UP((daystofirst-30)/30,6)
                    dim trm as n = 0
                    dim formu as n
                    'dim factor as n 
                    var->factor = round_up((rte*df)*p,8) 'round_down() does not work in v7
                    formu = round_up(p+var->factor,5)
                    pmtonapr = round_down(pmts1(formu,r,mos),2)
                    
                    end if
                    
                    end function
                    Last edited by DaveM; 04-19-2016, 12:28 PM.
                    Dave Mason
                    [email protected]
                    Skype is dave.mason46

                    Comment

                    Working...
                    X