Working with Functions

The Recipe Builder provides a set of functions common to most spreadsheet programs. The following table summarizes the available recipe functions and their syntax. All trigonometric functions require values entered in radians.

Functions

When you select the function...

The Recipe Builder calculates the...

Syntax

ABS

Absolute value of number.

ABS (number)

ACOS

Arccosine of number.

ACOS (number)

ASIN

Arcsine of number.

ASIN (number)

ATAN

Arctangent of number.

ATAN (number)

COS

Cosine of number.

COS (number)

EXP

Anti-log of number.

EXP (number)

INT

Integer value of number.

INT (number)

LOG

Natural log of number.

LOG (number)

LOG10

Base 10 log of number.

LOG10 (number)

SIN

Sine of number.

SIN (number)

SQRT

Square root of the number.

SQRT (number)

TAN

Tangent of number.

TAN (number)

In addition to the functions listed in the previous table, the Recipe Builder also provides the Lookup and Index functions. These functions help you locate a value within a list.

The Lookup Function

The Lookup function locates and uses the nth value in a list, where n is a zero-based integer. You can use the following syntax for this function:

LOOKUP (number; numeric list)
or
LOOKUP (number; string list)

The Lookup function also allows you to substitute a variable name or keyword anywhere you can use a number or string value.

When the Recipe Builder evaluates the Lookup function, it uses the value of number to select the appropriate value from the list. For example, consider the following:

Identifier

Formula

Calc Val

#Yeast

3

3

#Result

LOOKUP (#Yeast;0;150;300;450;600)

450

When the Recipe Builder evaluates this function, it uses the value of the variable #Yeast to determine the value of the function. The following table lists the possible values of the function.

If the value of #Yeast is...

Then the function evaluates to...

0

0

1

150

2

300

3

450

4

600

None of the above

??????

The Index Function

The Index function is similar to the Lookup function. The Index function locates the position of a number or string within a list. The position of each item is zero-based. As a result, the first item evaluates to zero, the second item to one, the third item to two, and so on. You can use the following syntax for this function:

INDEX (number; numeric list)
or
INDEX (string; string list)

The Index function also allows you to substitute a variable name or keyword anywhere you can use a number or string value.

When the Recipe Builder evaluates this function, it searches for a match between number or string and the accompanying list. If it does not find a match, the value of function equals the number of items in the list. If it finds a match, the function equals the position of the located item in the list.

For example, consider the following:

Identifier

Formula

Calc Val

#Beer_Type

"Ale"

"Ale"

#Result

INDEX (#Beer_Type; "Dark Beer"; "Ale"; "Mead"; "Stout")

1

When the Recipe Builder evaluates these recipe items, it searches the list for the value of #Beer_Type. Since the value of #Beer_Type is "Ale", the Index function yields a value of one. The following table lists all possible values of the function.

If the value of #Beer_Type is...

The value of the formula is...

"Dark Beer"

0

"Ale"

1

"Mead"

2

"Stout"

3

None of the above

4

NOTE: The Index function does non-case sensitive string matching when string values are specified.

iFIX supports the international formats supported in Windows. The recommended list separator for the Index and Lookup functions is a semicolon (;).