473,395 Members | 1,456 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Payment calculation for Rate discount

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 loopIndexInteger = 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 loopIndexInteger

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 1509
kenobewan
4,871 Expert 4TB
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 loopIndexInteger.

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

Hope that this helps.
Jan 11 '07 #2
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 loopIndexInteger.

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 Expert 4TB
Please show how you declare and get a value for maximumInteger...
Jan 11 '07 #4
Please show how you declare and get a value for maximumInteger...

This is how I declare and setup for the loop.

Dim loopIndexInteger As Integer
Dim maximumInteger As Integer

For loopIndexInteger = 0 To maximumInteger

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

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

Next loopIndexInteger

Thanks,
Jan 11 '07 #5
kenobewan
4,871 Expert 4TB
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
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 LoopIndexInteger 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 PrincipalTextBox.Text <> "" And NumpmtTextBox.Text <> "" And InterestRateTextBox.Text <> "" And Prod2DiscountCheckBox.Checked = True And Prod2M1TextBox.Text <> "" And Prod2D1TextBox.Text <> "" And Prod2Disd1TextBox.Text <> "" And _
Prod2M1 = SheetObj.Cells(exRow, 1).value Then

For LoopIndexInteger = 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 loopIndexInteger

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 Expert 4TB
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
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. ...
5
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...
0
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....
6
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...
4
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...
3
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...
13
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...
3
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...
8
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...

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.