Использование Application.InputBox()
:
Function interests_paid_between(rate As Double, firstPer As Integer, lastPer As Integer, NPER As Integer, PV As Double) As Variant
Dim FutureValue As Double
FutureValue = Application.InputBox("What is the future value of the loan? (if it is 0 put 0 else the value)", Type:=1)
Dim i As Integer
For i = firstPer To lastPer
InterestPaid = InterestPaid + IPmt(rate, i, NPER, PV, FutureValue)
Next i
interests_paid_between = InterestPaid
End Function
В ячейку введено:
=interests_paid_between(0.05,1,5,12,-1000)
и ввод 1200 Я получаю:
Я не знаю, правильны ли расчеты, но по крайней мере это не ноль.