Advanced Formula in Tables has two types of operators: the basic operators and the logical operators.
Basic Operators
Basic operators in Advanced Formula are used with values, either referenced to a column or manually entered, to perform common operations, such as addition, subtraction, multiplication, etc.
Examples:
- =5+2 will evaluate to 7.
- =”one”&”-“&”half” will return one-half.
- =5+4-3/2*1&”%” will output to 7.5%.
The following are basic operators you can use in Tables:
| Operator | Description |
|---|---|
| & | Concatination operator.For example, =”Hello”&” “&”world” will return Hello world. |
| + | Addition operator.For example, =10+2 will evaluate to 12. |
| – | Subtraction operator.For example, =10-2 will evaluate to 8. |
| / | Division operator.For example, =10/2 will evaluate to 5. |
| * | Multiplication operator.For example, =10*2 will evaluate to 20. |
| , | Augment operator. Used as a delimiter to separate arguments in a function.For example, =SUBSTITUTE(“Sunday”,”day”,””). |
Logical Operators
In Tables, logical operators (also known as comparison operators) can be used like basic operators to create logical expressions for comparing values. An expression returns TRUE if it’s correct and FALSE if not.
Examples:
- =5>3 will return TRUE.
- =5+3=8 will return TRUE.
- =”Apples”=”Oranges” will return FALSE.
- ={Number}>0 will return TRUE if the Number column’s value is greater than 0 and FALSE otherwise.
- ={Answer}=”Yes” will return TRUE if the Answer column’s value is “Yes” and FALSE if not.
In Tables, TRUE (bool) outputs either 1 or “true,” while FALSE (bool) outputs either 0 or an empty string.
Here’s a list of logical operators you can use in Tables:
| Operator | Description |
|---|---|
| > | Greater than |
| >= | Greater than or equal to |
| < | Less than |
| <= | Less than or equal to |
| = | Equal |
Logical expressions are often used with Logical Functions. For example, =IF({Age}>=18,”Approved”,”Denied”) will return Approved if the Age column’s value is greater than or equal to 18 and Denied otherwise. See Logical Functions for more information.
See also:
Send Comment: