Technical data
Using Built-in Functio ns in Analytic Models Chapter 11
Example
Suppose that yo
u wish to invest 5,000 USD at the end of each year for 10 years. You can create a data cube
called RATE_R
EQUIRED and calculate the rate of return required to earn 100,000 USD as follows:
RATE(10, -5000
, 0, 100000) = 14.69%
Now suppose that you initially invest 15,000 USD in addition to the yearly payments. Use the following
formula:
RATE(10, -500
0, -15000, 100000) = 7.23%
Finally, suppose that you make the payments at the start of the year. You can use the following formula:
RATE(10, -5000
, -15000, 100000, 1) = 6.50%
REPLACE
Syntax
REPLACE (Text
, Old, New)
Description
The REPLACE function replaces all occurrences of Old with New in text and returns the result.
Example
REPLACE("StringFun", "Fun", "Number") returns StringNumber.
RETURN
Description
The RETURN function stops the evaluation of a rule and returns the value of the RETURN function’s argument.
Example
WHILE(&Balance < TARGET_BALANCE,
IF(&Month > NUMMEMBERS(MONTHS), RETURN(#N/A));
INC(&Month);
INC(&Balance, AT(MONTHS, &Month, CASH_FLOW))
);
RETURN(&Mont
h)
This formula calculates the number of months required to accumulate a target balance, but returns an error
value if the maximum number of months is exceeded. This makes it unnecessary to repeat the condition at
the end of the formula.
Note. The RETURN at the end of the formula is not n ecessary; however, you can use it for clarity.
RIGHT
Description
The RIGHT function returns the right most Count characters of Text.
186 Copyright © 1988-2007, Oracl e. All rights reserved.