Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write an Excel VBA code that does the following: 1. a. Begin by writing a FUNCTION to discount cash flows and determine their NPV. Take
Write an Excel VBA code that does the following:
1. a. Begin by writing a FUNCTION to discount cash flows and determine their NPV. Take the discount rate, terminal growth rate and cash flows as inputs. Assume 8 cash flows, from time 0 to time 7 are input by the user (so you don't need to allow for a dynamically-sized array). b. Assume the last explicit period cash flow occurs at time 5, meaning that starting with the time 6 cash flow (the 7th value in the cash flow array), the cash flows will grow at the same rate forever. This isn't the most flexible function, but it works for the task at hand. Output the NPV to the user. C. 2. Choose three of the incorrect valuation methods provided in the Excel file, and write a FUNCTION for each that gives the matching, incorrect answer. Follow the same steps (re-use most of the code) from part 1. 3. Write a SUB (program) that takes the same inputs as the function, but also the user's answer to the problem. These inputs should be through input boxes; either enter values directly or enter cell references to the cells that contain the values. For example, if the time zero cash flow of $100 is in cell C9, you can either enter $100 or 29 into the input box. Check whether the answer is correct (to the nearest dollar). If not, test whether their answer matches one of the known errors from the three incorrect valuation functions you created (again, to the nearest dollar). Let the user know whether the answer is right or wrong, and if it is wrong, what mistake was likely made (or, if none of the incorrect answers matched, that an unknown mistake was made). 1. a. Begin by writing a FUNCTION to discount cash flows and determine their NPV. Take the discount rate, terminal growth rate and cash flows as inputs. Assume 8 cash flows, from time 0 to time 7 are input by the user (so you don't need to allow for a dynamically-sized array). b. Assume the last explicit period cash flow occurs at time 5, meaning that starting with the time 6 cash flow (the 7th value in the cash flow array), the cash flows will grow at the same rate forever. This isn't the most flexible function, but it works for the task at hand. Output the NPV to the user. C. 2. Choose three of the incorrect valuation methods provided in the Excel file, and write a FUNCTION for each that gives the matching, incorrect answer. Follow the same steps (re-use most of the code) from part 1. 3. Write a SUB (program) that takes the same inputs as the function, but also the user's answer to the problem. These inputs should be through input boxes; either enter values directly or enter cell references to the cells that contain the values. For example, if the time zero cash flow of $100 is in cell C9, you can either enter $100 or 29 into the input box. Check whether the answer is correct (to the nearest dollar). If not, test whether their answer matches one of the known errors from the three incorrect valuation functions you created (again, to the nearest dollar). Let the user know whether the answer is right or wrong, and if it is wrong, what mistake was likely made (or, if none of the incorrect answers matched, that an unknown mistake was made)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started