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(&Month)
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 necessary; however, you can use it for clarity.