2. Expressions
Prev | Chapter 3. The language used to write formulas | Next

## 2. Expressions

Expressions use the following operators to combine primary expressions (function calls, literals, references, etc). Operators are listed from highest priority to lowest priority.

- -`number` negation like in -1.

- `number`% percentage like in 10%

- `number1`^`number2` exponentiation: 2^3=8

- `number1`*`number2` multiplication. `number1`/`number2` division.

- `number1`+`number2` addition. `number1`-`number2` subtraction.

- `string1&``string2` string concatenation: "black"&"white"="blackwhite".

- `value1`=`value2` (equal). `value1`<>`value2` (different). `number1`<`number2` (less than). `number1`<=`number2` (less than or equal). `number1`>`number2` (greater than). `number1`>=`number2` (greater than or equal).

Unlike in other spreadsheet software, there are no union and intersection operators. Use the union() and intersection() functions. (The difference() function is also very useful.)

Unlike in other languages, there are no test, logical and, logical or and logical negation operators. Use the following functions for that: if(), and(), or(), not().[4]

Parentheses may be used to group subexpressions. Example:

    = 2+2*3

means:

    = 2 + (2*3)

because the priority of '*' is higher than the priority of '+'. If, in fact, you did not intended to write this, you must use parentheses:

    = (2 + 2)*3

[4] The documentation of functions is exclusively available online. Use the Paste Function tab of the Formula Editor to browse it.

Prev | Up | Next
1. Statements and comment lines | Home | 3. Function calls