ClassMicrosoft.VisualBasic.Financial SyntaxDim result As Double = NPer(rate, pmt, pv [, fv [, due]])
DescriptionThe NPer function determines the number of payment periods for an annuity, based on regular fixed payments and a fixed interest rate. An annuity is a series of fixed cash payments made over a period of time. It can be either a loan or an investment. Usage at a Glance
ExampleThis sample displays the amount of time needed to pay off a credit card. It uses the NPer function to determine the length of time required. Public Sub HowLongToPay( ) ' ----- Detail the extent of a debt. Dim interestRate As Double Dim currentBalance As Double Dim monthlyPayment As Double Dim totalPeriods As Integer Try currentBalance = CDbl(InputBox("Credit card balance.")) monthlyPayment = CDbl(InputBox("Monthly payment.")) interestRate = CDbl(InputBox("Monthly interest rate " & _ "(use 0.05 for 5%).")) totalPeriods = CInt(NPer(interestRate, -monthlyPayment, _ currentBalance, 0#, DueDate.BegOfPeriod)) MsgBox("Your credit card balance will be paid in " & _ totalPeriods & " months. That's " & _ Int(totalPeriods / 12) & " years and " & _ (totalPeriods Mod 12) & " months.") Catch e As System.Exception MsgBox("Unable to compute period because of error " & _ e.Message) End Try End Sub See AlsoFV Function, IPmt Function, NPV Function, Pmt Function, PPmt Function, PV Function, Rate Function |