fm3_problems39

fm3_problems39 - RCMyPV in Action 100 100 100 ###...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: RCMyPV in Action 100 100 100 ### <-- =RCMyPv(A3:C3) 100 100 ### <-- =RCMyPv(A3:A5) A B C D E F 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 Function RCMyPV(CF As Variant) As Double Dim X As Variant, Temp As Double, i As Integer Dim IsRow As Boolean X = CF: Temp = 0 If IsArray(X) Then If UBound(X) = 1 Then IsRow = True Else IsRow = False If IsRow Then For i = 1 To UBound(X, 2) Temp = Temp + X(1, i) / 1.05 ^ i Next i Else For i = 1 To UBound(X) Temp = Temp + X(i, 1) / 1.05 ^ i Next i End If Else Temp = X / 1.05 End If RCMyPV = Temp End Function G 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 MyPV in Action PositiveR 5% 100 100 100 ### NegativeR 10%-100-100-100 ###-100 100 100 ### ### <-- =MyPV(C12:C14,$B$12 A B C D E F 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 <-- =MyPV(C12:E12,$B$12,$B$13) <-- =MyPV(C13:E13,$B$12,$B$13) <-- =MyPV(C14:E14,$B$12,$B$13) 2,$B$13) Function MyPV(CF As Variant, PositiveR As Double, _ NegativeR As Double) As Double Dim X As Variant, Temp As Double, i As Integer Dim r As Double, IsRow As Boolean X = CF: Temp = 0 If IsArray(X) Then If UBound(X) = 1 Then IsRow = True Else IsRow = False If IsRow Then For i = 1 To UBound(X, 2) If X(1, i) < 0 Then r = NegativeR _ Else r = PositiveR Temp = Temp + X(1, i) / (1 + r) ^ i Next i Else For i = 1 To UBound(X) If X(i, 1) < 0 Then r = NegativeR _ Else r = PositiveR Temp = Temp + X(i, 1) / (1 + r) ^ i Next i End If Else If X < 0 Then r = NegativeR Else r = PositiveR Temp = X / (1 + r) End If MyPV = Temp End Function G 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 RCMyFV in Action 100 100 100 #MACRO? <-- =RCMyFv(A3:C3) 100 100 #MACRO? <-- =RCMyFv(A3:A5) A B C D E F 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 Function RCMyFV(CF As Variant) As Double Dim X As Variant, Temp As Double, i As Integer Dim IsRow As Boolean...
View Full Document

Page1 / 16

fm3_problems39 - RCMyPV in Action 100 100 100 ###...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online