473,810 Members | 3,142 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Payment calculation for Rate discount

4 New Member
I need help for my payment calculation. When I applied Rate Discount into the worksheet for calculate loan amortize, the looping in interest rate, monthly payment, and remain principal balance are not continue even I setup a loop like this:

For loopIndexIntege r = 0 To maximumInteger

SheetObj.Cells( exRow, 2) = SheetObj.Cells. Item(exRow, 4).value * (prod3disd1 / 100) / 12
SheetObj.Cells( exRow, 3) = MonthlyPmt - SheetObj.Cells. Item(exRow, 2).value

Next loopIndexIntege r

still having problem.

This is my output look like in excel worksheet Please see # Payment in 3, 6, 9.

Loan Amount: $30,000.00
Interest Rate: 8.00%
Years of Loan 10
Monthly Payment: $363.98

#Payment Interest Principal Pmt Principal Bal

1 200.00 163.98 29,836.02
2 198.91 165.08 29,670.94
3 147.52 216.46 29,504.76
4 196.70 167.28 29,337.48
5 195.58 168.40 29,169.08
6 145.00 218.98 28,999.56
7 193.33 170.65 28,828.91
8 192.19 171.79 28,657.12
9 118.68 245.30 28,484.18
10 189.89 174.09 28,310.09
11 188.73 175.25 28,134.84
12 187.57 176.42 27,958.43

------------------------------------------------------------------------------------------------------------------
Also, when I set option strict on, it gave me an error message said " option strict on disallows late binding". This is how I coding in my vb: SheetObj.Cells( exRow, 3) = MonthlyPmt - SheetObj.Cells. Item(exRow, 2).value.

Thank you.
Jan 10 '07 #1
7 1534
kenobewan
4,871 Recognized Expert Specialist
If you are getting one output and no error (except strict one), then there is a problem with the loop. From what I can see there is one syntax error - just use next not next loopIndexIntege r.

Please show how you declare and get a value for maximumInteger. ..

Hope that this helps.
Jan 11 '07 #2
Kawaka Ku
4 New Member
If you are getting one output and no error (except strict one), then there is a problem with the loop. From what I can see there is one syntax error - just use next not next loopIndexIntege r.

Please show how you declare and get a value for maximumInteger. ..

Hope that this helps.
Thank you for your replied. I know that I have problem in the loop but just cannot find the problem. I have been tried the For and next first, it cause the same problem as well.

Thank.
Jan 11 '07 #3
kenobewan
4,871 Recognized Expert Specialist
Please show how you declare and get a value for maximumInteger. ..
Jan 11 '07 #4
Kawaka Ku
4 New Member
Please show how you declare and get a value for maximumInteger. ..

This is how I declare and setup for the loop.

Dim loopIndexIntege r As Integer
Dim maximumInteger As Integer

For loopIndexIntege r = 0 To maximumInteger

SheetObj.Cells( exRow, 2) = SheetObj.Cells. Item(exRow, 4).value * (Prod3Disd1Text Box.Text / 100) / 12

SheetObj.Cells( exRow, 3) = MonthlyPmt - SheetObj.Cells. Item(exRow, 2).value

Next loopIndexIntege r

Thanks,
Jan 11 '07 #5
kenobewan
4,871 Recognized Expert Specialist
You declare maximumInteger as an integer, but it does not have a value - therefore the loop does not work correctly. Where are you going to get the value from?
Jan 12 '07 #6
Kawaka Ku
4 New Member
You declare maximumInteger as an integer, but it does not have a value - therefore the loop does not work correctly. Where are you going to get the value from?

You are right. I forgot to assigned the value for the variable for maximuminteger. However, I tried the other way like this:

Dim LoopIndexIntege r as Integer


SheetObj.Cells( exRow, 2) = PrinAmt * (Intdisc / 12)

SheetObj.Cells( exRow, 3) = MonthlyPmt - SheetObj.Cells( exRow, 2).value

PrinAmt = PrinAmt - SheetObj.Cells( exRow, 3).value

SheetObj.Cells( exRow, 4) = PrinAmt - SheetObj.Cells( exRow, 3).value

SheetObj.Cells( exRow, 4) = PrinAmt - SheetObj.Cells. Item(6, 3).value


If Product2TextBox .Text <> "" And PrincipalTextBo x.Text <> "" And NumpmtTextBox.T ext <> "" And InterestRateTex tBox.Text <> "" And Prod2DiscountCh eckBox.Checked = True And Prod2M1TextBox. Text <> "" And Prod2D1TextBox. Text <> "" And Prod2Disd1TextB ox.Text <> "" And _
Prod2M1 = SheetObj.Cells( exRow, 1).value Then

For LoopIndexIntege r = 1 to 20

PrinAmt = PrinAmt - SheetObj.Cells( exRow, 3).value

SheetObj.Cells( exRow, 2) = SheetObj.Cells. Item(exRow, 4).value * Prod2disd1 / 100) / 12

SheetObj.Cells( exRow, 3) = MonthlyPmt - SheetObj.Cells. Item(exRow, 2).value

Next loopIndexIntege r

and still won't work correctly. Please see the out put for Excel worksheet.

16 128.75 158.95 22,561.48
17 108.27 179.43 22,401.62
18 106.72 180.98 18,651.69
19 105.69 182.01 18,469.68
20 104.66 183.04 18,286.64
21 103.62 184.08 18,102.56
22 102.58 185.12 17,917.44
23 101.53 186.17 17,731.28
24 100.48 187.22 17,544.05
25 99.42 188.28 17,355.77
26 98.35 189.35 17,166.42
27 97.28 190.42 16,975.99
28 96.20 191.50 16,784.49
29 95.11 192.59 16,591.90
30 94.02 193.68 16,398.22
31 92.92 194.78 16,203.44

I applied with 1% interest rate disd into line 17 and the loop is fine in Interest and Principal Pmt. But in Remain Balance is not correct.

Please see the following excel worksheet. If I applied 2% into line 17 and the loop is seem to be incorrect.

17 89.61 198.09 22,401.62
18 104.71 182.99 18,294.99
19 103.67 184.03 18,110.96
20 102.63 185.07 17,925.88
21 101.58 186.12 17,739.76
22 100.53 187.18 17,552.59
23 99.46 188.24 17,364.35
24 98.40 189.30 17,175.05
25 97.33 190.38 16,984.67
26 96.25 191.45 16,793.22
27 95.16 192.54 16,600.68
28 94.07 193.63 16,407.05
29 92.97 194.73 16,212.32
30 91.87 195.83 16,016.49
31 90.76 196.94 15,819.55

In the above worksheet, after I applied interest rate of 2% into line 17 and the following line #18 and down is seem to be not in the loop. Could you please help me with this problem?
Thanks.
Jan 12 '07 #7
kenobewan
4,871 Recognized Expert Specialist
Please confirm whether you receive an error, your line that calculates the incorrect column and whether the loop completes. If the loop is now problem free, I am leaning towards a problem in the calculation...
Jan 13 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

3
2587
by: Ron | last post by:
I searched php.net last night for a payment function with no luck. Does anyone now if this exists? Want to pass in a loan amount, rate and term to return payment. Appreciate any leads. Thanks, Ron
5
3324
by: Michael Hagstrom | last post by:
Good Day - I have written a form which collects input for a fare calculation. The form collects the following: 1) Departure or Destination Group (1,2,or 3) 2) Number of Adults 3) Number of Children aged 4 to 12 4) Number of Children under age 4
0
1740
by: Jason | last post by:
I need help designing a query (or two) in MS Access that will calculate a compounded rate of interest. This would be no problem using a simple FV function if the Interest Rate were constant. Unfortunately the Interest rate changes through time. Whenever a new interest rate period begins, I need to calculate the interest for the new period using the ending balance from the previous interest rate period. See example below. Unfortunately,...
6
1683
by: gsb58 | last post by:
Hi! Recently we, in Norway changed to three different VAT levels. All three needs to be on the invoice program. This is easy obtained via a new field and set the rowsource to valuelist and make the three values : 0;0,00;0,06;0,12;0,25. However my problem is calculating the orderlines and make them be summed in a textbox in the footer of the frmOrderlines.
4
2514
by: sara | last post by:
i am studying a computer engineering and i started taking programming using C++ since month i have question i think it`s easy for you all *prof.programmer* but it`s bit diffecult for me plzz i need your help. (: this is the question: ** A new telephone communication company needs a billing calculation program. The cost of a call is based on the following three inputs that should be entered by the user, and they are explained as follows.
3
6707
by: cameron | last post by:
Hi I am new here in this forum: I am writing a C++ program to calculate a Montly Mortgage Payment where the loan amount is 200,000.00 with a 5.75% interest rate with a term of 30 years. My program compiles fine with no errors but my calculation is not working correctly, any suggestions would be great as this assignment is due on Monday: //******************************************************* //Program: Calculations Payments //Purpose: To...
13
2492
by: Wayne | last post by:
I have just experienced my first late paying client. By "late" I mean that the invoice is now almost 2 months overdue. I don't think that the client is maliciously withholding payment - rather there has been an unfortunate series of events which has delayed the payment. The bottom line for a small time developer is still the same however. I am confident that I will receive payment for the invoice eventually but it is now a case of "once...
3
2287
by: tracy36 | last post by:
I have an html form with three fields that need to calculate the total and onchange put the amount on a text field, should be simple enough for the gurus, I started it but cannot get it right. Here is the formula: Logo Solutions: (LIST) Starter Package - $159 Pro Package - $359 Wholistic Package - $659 Promtional Code: (TEXT) NU0507 If Starter Discount = -$25
8
2062
by: gnewsgroup | last post by:
I have never done anything involving handling credit card payment online. I searched this forum a little bit, and found a few related questions. But, I am still not clear how the solutions they talked about work. I do NOT want my users to go to another domain (either through a popup window or not) to make the payment and redirected back to my web site, because this does not sound professional. In other words, I would like to handle...
0
9603
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10379
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10393
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10124
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6882
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5690
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4334
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.