Financial.NPer メソッド
アセンブリ: Microsoft.VisualBasic (microsoft.visualbasic.dll 内)
構文
Public Shared Function NPer ( _ Rate As Double, _ Pmt As Double, _ PV As Double, _ <OptionalAttribute> Optional FV As Double = 0, _ <OptionalAttribute> Optional Due As DueDate = DueDate.EndOfPeriod _ ) As Double
Dim Rate As Double Dim Pmt As Double Dim PV As Double Dim FV As Double Dim Due As DueDate Dim returnValue As Double returnValue = Financial.NPer(Rate, Pmt, PV, FV, Due)
public static double NPer ( double Rate, double Pmt, double PV, [OptionalAttribute] double FV, [OptionalAttribute] DueDate Due )
public: static double NPer ( double Rate, double Pmt, double PV, [OptionalAttribute] double FV, [OptionalAttribute] DueDate Due )
public static double NPer ( double Rate, double Pmt, double PV, /** @attribute OptionalAttribute() */ double FV, /** @attribute OptionalAttribute() */ DueDate Due )
public static function NPer ( Rate : double, Pmt : double, PV : double, FV : double, Due : DueDate ) : double
- Rate
必須。投資期間を通じて一定の利率を示す Double 型の値。たとえば、10% の年率 (APR) で自動車ローンを利用する際、毎月の支払いを指定した場合の月々の利率は 0.1/12 (0.0083) になります。
- PV
必須。現在の投資額、つまり将来行われる一連の支払いや受け取りを現時点で一括した場合の合計金額を示す Double 型の値。たとえば、自動車を購入するために資金を借り入れた場合、ローン金額は、毎月の返済の対象となる貸手にとっての現在価値を表します。
- FV
省略可能。投資の将来価値、つまり最後の支払いを行った後に残る現金の収支を示す Double 型の値。たとえば、ローンの将来価値は 0 です。最終支払い後の価値であるためです。ただし、子供の教育費のため、18 年間かけて 50 万円を貯金する場合、この 50 万円は将来価値になります。省略した場合、0 が使用されます。
- Due
省略可能。支払い期日を示すオブジェクト型 DueDate 列挙型 の値。各期の期末に支払う場合は DueDate.EndOfPeriod を、各期の期首に支払う場合は DueDate.BegOfPeriod をそれぞれ引数に指定します。省略した場合は、DueDate.EndOfPeriod を指定したものと見なされます。
定期的な定額の支払いおよび一定した利率に基づいて、投資に必要な期間を指定する Double 型の値を返します。
詳細については、Visual Basic のトピック「NPer 関数」を参照してください。
投資とは、一連の定額の支払いを一定の期間行うことです。たとえば、住宅ローンなどのローンまたは毎月の貯蓄プランなどの出資を指します。
すべての引数は、現金の支出 (口座への預け入れなど) を負数で表し、現金の受け取り (配当小切手など) を正数で表します。
この例では、NPer 関数を使用して、PVal に総額が指定されたローンの支払い回数を返します。利率 (APR / 12)、毎月の支払い額 (Payment)、将来価値 (FVal)、および支払い期日 (PayType) も指定します。
Sub TestNPer() Dim TotPmts As Double Dim PVal, APR, Payment As Double Dim PayType As DueDate Dim Response As MsgBoxResult ' Usually 0 for a loan. Dim Fval As Double = 0 PVal = CDbl(InputBox("How much do you want to borrow?")) APR = CDbl(InputBox("What is the annual percentage rate of your loan?")) ' Usually 0 for a loan. If APR > 1 Then APR = APR / 100 Payment = CDbl(InputBox("How much do you want to pay each month?")) Response = MsgBox("Do you make payments at the end of month?", MsgBoxStyle.YesNo) If Response = MsgBoxResult.No Then PayType = DueDate.BegOfPeriod Else PayType = DueDate.EndOfPeriod End If TotPmts = NPer(APR / 12, -Payment, PVal, FVal, PayType) If Int(TotPmts) <> TotPmts Then TotPmts = Int(TotPmts) + 1 MsgBox("It will take you " & TotPmts & " months to pay off your loan.") End Sub
Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
参照
- Financial.NPer メソッドのページへのリンク