+ Reply to Thread
Results 1 to 13 of 13

Using excel financial functions for determining principal paid

  1. #1
    Registered User
    Join Date
    09-01-2015
    Location
    MN, USA
    MS-Off Ver
    2010
    Posts
    6

    Using excel financial functions for determining principal paid

    Hi,

    I'm looking for a vba solution to determine when a loan will reach 80% and 50% paid principal.

    Currently, I am using excel's native financial functions and looping through until I reach those points.
    For every payment I separate the interest and the principal paid. I subtract the principal paid from the loan amount.
    I do this until the loan balance reaches the 80% mark and the 50% mark. Is there a more effective manner to do this rather than using a loop? This becomes problematic when I have a large number of loans.

    I couldn't figure out how to do it with Excel's native functionality.

    I am not looking for a solution that uses the spreadsheet. I want to do it in vba.

    Thank you

  2. #2
    Valued Forum Contributor quekbc's Avatar
    Join Date
    01-18-2010
    Location
    Sydney, Australia
    MS-Off Ver
    2010, 2013, 2016
    Posts
    1,149

    Re: Using excel financial functions for determining principal paid

    Maybe it could be solved arithmetically. What's the repayment method for the loan?

  3. #3
    Forum Expert
    Join Date
    05-01-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    1,795

    Re: Using excel financial functions for determining principal paid

    Quote Originally Posted by phineas629 View Post
    I'm looking for a vba solution to determine when a loan will reach 80% and 50% paid principal. [....] I am not looking for a solution that uses the spreadsheet. I want to do it in vba.
    Understood. But it might be best to start with Excel.

    Suppose the loan amount is in B1, the periodic interest rate is in B2, and the number of payments is in B3. The payment in B4 is:

    =PMT(B2,B3,-B1)

    Suppose the percentage paid (e.g. 50% or 80%) is in B5. The number of payments is:

    =NPER(B2,B4,-B1,B1*(1-B5))

    In VBA:
    Please Login or Register  to view this content.
    Caveat: I am using the VBA functions Pmt and NPer here. Alternatively, use the Excel-like functions WorksheetFunction.Pmt and WorksheetFunction.NPer. There is a subtle difference in results.

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,451

    Re: Using excel financial functions for determining principal paid

    Hi Phineas and welcome to the forum,

    I've been hunting for some examples of VBA financial functions and found the following link. I think it expresses my opinion better than I can.

    http://www.proformative.com/question...-pros-and-cons

    My opinion is "Why would you want to do VBA for a built in function that already works?"
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  5. #5
    Registered User
    Join Date
    09-01-2015
    Location
    MN, USA
    MS-Off Ver
    2010
    Posts
    6
    I was hoping there would be a way to calculate with excel's native functionality but I don't know the correct financial function to use. If you know then please share.

    What I don't want to do is paste a loan schedule on a sheet to determine when principal paid has reached a certain percentage. That can be tedious when looking at thousands of loans.


    Thanks



    Quote Originally Posted by MarvinP View Post
    Hi Phineas and welcome to the forum,

    I've been hunting for some examples of VBA financial functions and found the following link. I think it expresses my opinion better than I can.

    http://www.proformative.com/question...-pros-and-cons

    My opinion is "Why would you want to do VBA for a built in function that already works?"

  6. #6
    Forum Expert
    Join Date
    05-01-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    1,795

    Re: Using excel financial functions for determining principal paid

    Quote Originally Posted by phineas629 View Post
    I was hoping there would be a way to calculate with excel's native functionality but I don't know the correct financial function to use. If you know then please share.
    Did you not see my response #3?!

  7. #7
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Using excel financial functions for determining principal paid

    Pl see file with UDF, which gives result in months.
    Code
    Please Login or Register  to view this content.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    09-01-2015
    Location
    MN, USA
    MS-Off Ver
    2010
    Posts
    6

    Re: Using excel financial functions for determining principal paid

    Hi, I missed it since I was typing on my phone. I'll give that function a try.

  9. #9
    Registered User
    Join Date
    09-01-2015
    Location
    MN, USA
    MS-Off Ver
    2010
    Posts
    6

    Re: Using excel financial functions for determining principal paid

    How would this UDF be changed to handle changes in interest rate?


    Quote Originally Posted by kvsrinivasamurthy View Post
    Pl see file with UDF, which gives result in months.
    Code
    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    09-01-2015
    Location
    MN, USA
    MS-Off Ver
    2010
    Posts
    6

    Re: Using excel financial functions for determining principal paid

    Hi Joue,

    Thank you for explanation with the function. That helped a lot.

    Can this handle changes in interest?

  11. #11
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Using excel financial functions for determining principal paid

    YrlyRate Can be entered in a cell and give that cell reference in the function.

  12. #12
    Registered User
    Join Date
    09-01-2015
    Location
    MN, USA
    MS-Off Ver
    2010
    Posts
    6

    Re: Using excel financial functions for determining principal paid

    Would you be able to show me how to do it?

    I am not familiar with the financial functions. It would be easier if I had a working example to break down.
    I think after I see how it's done on the worksheet like you show then I should be able to do it completely in vba.

    Thanks for the help thus far guys!

    Quote Originally Posted by kvsrinivasamurthy View Post
    YrlyRate Can be entered in a cell and give that cell reference in the function.

  13. #13
    Forum Expert
    Join Date
    05-01-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    1,795

    Re: Using excel financial functions for determining principal paid

    Quote Originally Posted by phineas629 View Post
    Hi Joue, Thank you for explanation with the function. That helped a lot. Can this handle changes in interest?
    You're welcome.

    If you mean different fixed rates throughout the life of the loan, simply modify B2.

    But if you mean variable rates during the life of the loan, no Excel function can handle that. You will need to use a VBA implementation similar to the UDF suggested by kvsrinivasamurthy. However, Loan, YrlyRate, Pmt and ResLoan should be type Double. And it would be prudent use the declaration ByVal YrlyRate, just in case the UDF is called from another VBA procedure, since YrlyRate is changed within the UDF.

    For details, first you will need to explain how you want to specify the list of applicable interest rates. For example, you might pass a 2-dimensional range where one column is the interest rate and another column is the first payment number when the interest rate applies.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. formula to calculate sum of principal paid in an annuity
    By excsal in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-13-2014, 12:00 PM
  2. Financial functions
    By danieluk9 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-13-2014, 05:48 AM
  3. Excel 2007 : Help with Financial Functions
    By GFG in forum Excel General
    Replies: 5
    Last Post: 10-04-2010, 03:17 PM
  4. Financial Functions
    By mpsvictor in forum Excel General
    Replies: 1
    Last Post: 08-02-2010, 08:21 AM
  5. Financial Functions
    By cfalevel_1 in forum Excel General
    Replies: 0
    Last Post: 01-28-2007, 12:14 PM
  6. financial functions dll
    By Rea in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-05-2006, 09:45 AM
  7. Using Financial Functions
    By TEreba in forum Tips and Tutorials
    Replies: 2
    Last Post: 08-29-2005, 11:25 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1