Question: Create a User Defined Function to calculate the present value of a growing finite ordinary annuity and name it PVGFOA. The arguments must be C,

Create a User Defined Function to calculate the present value of a growing finite ordinary annuity and name it PVGFOA. The arguments must be C, r, g, and n (in that order). See page 18 of your text, the Chapter 1 workbook, and the class lecture notes if you need help with formulas. The function should be capable of computing a value for any reasonable set of inputs, including the special case where r = g. (Hint: If the discount rate is not equal to the growth rate, then the book formula used in class works. If not, then you need to derive a different but simple formula to calculate the answer to the function. For help with similar VBA code see the ADDING3 function in the Example Function.xlsmworkbook.

Example: * I NEED FOR A PVGFOA FUNCTION THOUGH*

unction PVGFOA(C, r, g, n)

'The arguments are:

' C = Any number

' r = Any number

' g = Any number

' n = Any number

If x + y + z >= 0 Then

ADDING3 = x + y + z

' More lines of code could be inserted here if needed!

'Second, if the sum is negative change it to positive:

Else: ADDING3 = (-1) * (x + y + z)

' More lines of code could be inserted here if needed!

End If

'All done!

End Function

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Finance Questions!