Formulas
Create a formula
To create a new formula, perform the following actions:
- To create a new formula, choose New > Formula from the menu. A new window that shows the properties for the formula is displayed.
- Give the expression a name by typing it in the Name field. Include the arguments in parentheses.
- Each formula should have a unique name. The name should begin with a letter followed by any combination of letters, numbers or underscores. No other characters are allowed.
- Arguments (parameters) should be between parentheses and comma separated. The argument name should contain only letters a - z and A - Z.
- Type the expression to be calculated in the Body field. Make sure that the variable(s) used in the expression has/have the exact same name as the argument(s) in the name.
- The body should contain a valid calculation that adheres to the following rules concerning allowed operators, standard functions and values.
- Expressions (calculations) can be grouped by the use of parentheses.
- If you would like to add a description of or comments to the expression, you can type it in the Comments field.
- It is only accessible through the Properties window for each formula. Any input is allowed in this field. Press Ctrl + Enter to insert a line break in the field.
- Click the Create button to save the formula.
Allowed binary operators
+ | Addition, ex: 10+4 |
- | Subtraction, ex: 10-4 |
* | Multiplication, ex: 10*4 |
/ | Division, ex: 10/4 |
^ | Exponentiation, ex: 10^4 |
mod | Modulo, ex: ex:10mod4 |
> | Greater than, ex: 10>X |
< | Less than, ex: 4<X |
= | Equals, ex: 10 = X |
& | Logical And, ex: (10 > X) & (X > 4) |
| | Logical Or, ex: (10 > X) | (X > 4) |
The comparison and logical operators always return either true or false. True is represented by 1 (one) and false by 0 (zero).
Allowed unary operators
- | Minus (prefix), ex: -3 |
Allowed values
Integer – Any positive or negative number that does not include a fraction or decimal, including zero.
Real – A number with an integer and a fractional part, i.e. any number that is not imaginary. Examples: 1.23156, 5, etc. A dot (.) is used for the fractional part. Comma is not allowed.
Parameter – The value that is passed to the expression as a parameter.
Allowed functions
abs(A) | Absolute value of A. If A is negative, returns –A, otherwise returns A. |
acos(A) | Arc-cosine of A. Returns the angle measured in radians, whose cosine is A. |
asin(A) | Arc-sine of A. Returns the angle measured in radians, whose sine is A. |
atan(A) | Arc-tangent of A. Returns the angle measured in radians, whose tangent is A. |
ceil(A) | Ceiling of A. Returns the smallest integer greater than A. Rounds up to the next higher integer. |
cos(A) | Cosine of A. Returns the cosine of the angle A, where A is measured in radians. |
exp(A) | Exponential of A. Returns the value of e raised to the power A where e is the base of the natural logarithm, i. e. the non-repeating value approximately equal to 2.71828182846. |
floor(A) | Floor of A. Returns the largest integer less than A. Rounds down to the next lower integer. |
int(A) | Rounds A to the closest integer. 0.5 is rounded to 1. |
ln(A) | Natural logarithm of A. Returns the logarithm base e
of the value A. |
log(A) | The logarithm of A. Returns the logarithm base 10 of
the value A. |
max(A,B) | If A>B, the result is A, else B. |
min(A,B) | If A<B, the result is A, else B. |
sin(A) | Sine of A. Returns the sine of the angle A, where A is
measured in radians. |
sqrt(A) | Square root of A. Returns the value whose square is
A. |
tan(A) | Tangent of A. Returns the tangent of the angle A,
where A is measured in radians. |