Microsoft Knowledge Base |
|
Excel: Macro to Calculate IRR() with Consistent Returns |
|
|
Last reviewed: June 30, 1997
Article ID: Q106149 |
|
The information in this article applies to:
SUMMARYOften when you calculate the internal rate of return for an item, you may have an initial payment with consistent periodic payments. If you use the IRR() function to make this calculation, you must repeat each payment. The following a custom function macro may help you simplify this process.
MORE INFORMATIONMicrosoft provides macro examples for illustration only, without warranty either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. This macro is provided 'as is' and Microsoft does not guarantee that the following code can be used in all situations. Microsoft does not support modifications of the code to suit customer requirements for a particular purpose.
Syntax of Custom FunctionThe syntax of this function is as follows
Consistent_IRR(initial,payment,periods,guess)where:
Initial is a required argument referring to the initial payment. (Enter initial payment as a negative value.) Payment is a required argument referring to the amount of the consistent payments Periods is a required argument referring to the number of payment periods. Guess is an optional argument referring to the guess argument for the IRR() function.To create this custom function:
Explanation of macro
A1: The Name of the Macro. A2: Defines data type of returned value. A3-A5: Defines data types of required input values. A6: Turns off error checking. This allows for optional arguments. A7: Defines data type of optional "Guess" argument. A8: Sets a default Guess value if none specified. A9: Enter initial payment value.A10-A12: For Next loop to enter all payment values. A13: Returns calculated IRR() value to worksheet. REFERENCES"Function Reference," version 4.0, pages 25, 247-247 "Function Reference," version 3.0, pages 15-16, 134-135 "Function and Macros," version 2.1, pages 251, 310
|
|
Additional reference words: 2.00 2.00c 2.00c 2.0 3.00 4.00 4.00a
©1997 Microsoft Corporation. All rights reserved. Legal Notices. |