经管之家送您一份
应届毕业生专属福利!
求职就业群
感谢您参与论坛问题回答
经管之家送您两个论坛币!
+2 论坛币
Function mcld(CouponRate As Double, n As Integer, k As Integer, yield As Double)
Dim i As Integer
Dim PVCF() As Double
Dim PVTCF As Double
Dim duration As Double
ReDim PVCF(1 To n * k)
PVTCF = 0
For i = 1 To n * k
PVCF(i) = ((CouponRate / k) * 100) / Application.WorksheetFunction.Power(1 + yield / k, i)
PVTCF = PVTCF + PVCF(i)
Next i
PVCF(n * k) = PVCF(n * k) + 100 / Application.WorksheetFunction.Power(1 + yield / k, n * k)
PVTCF = PVTCF + 100 / Application.WorksheetFunction.Power(1 + yield / k, n * k)
duration = 0
For i = 1 To n * k
duration = duration + PVCF(i) * i / k
Next i
duration = duration / PVTCF
mcld = duration
End Function
扫码加我 拉你入群
请注明:姓名-公司-职位
以便审核进群资格,未注明则拒绝
|