---
title: "Operators"
canonical: "https://help.agiloft.com/space/HELP/43719618/Operators"
format: markdown
---
The following operators can be used throughout the system in [Formulas](https://agiloft-public.atlassian.net/wiki/spaces/HELP/pages/43715029).

| **Operator** | **Definition** |
| --- | --- |
| * | multiply |
| / | divide |
| + | add |
| - | subtract |
| == | equals |
| != | not equals |
| >= | greater or equal to |
| <= | less than or equal to |
| > | greater than |
| < | less than |
| ~= | contains |
| !~= | does not contain |

> ✅ The operator !~= will not work in Document Templates.  As an alternative, you can use ~= as a "contains", inside of an extra set of parentheses with an exclamation point in front of it as a "not".  For instance, instead of something like `$startif($field_name !~= "substring")`, you can try something like `$startif(!($field_name ~= "substring"))`

Variable Formula fields use a slightly modified syntax and list of operators. For more information, see [Variable Formula Fields](https://agiloft-public.atlassian.net/wiki/spaces/HELP/pages/43715637).

# Logical Operators

You can combine formula criteria using logical operators such as AND and OR. These are:

| **Operator** | **Definition** | **Example** |
| --- | --- | --- |
| || | Or | `($priority == High || $priority == Low)` |
| && | And | `($contract_amount >= 50000 && $approval_required == 'Yes')` |

# Order of Operations

Formula expressions are evaluated in the following order:

1. Evaluate any expressions in parentheses.
2. Evaluate any AND (&&) operations.
3. Evaluate any OR (||) operations.
4. When there are multiple operations of the same type, evaluate them from left to right.

To ensure formulas evaluate as expected, use parentheses to control the order of operations, especially when combining AND and OR operations. For example, `A && (B || C)` evaluates to true if at least one of B or C is true and A is true. But `A && B || C` evaluates to true if both A and B are true or C is true.

Consider a more complex formula: `(A || B) && (C || (D && E))`

First, the expressions in parentheses are evaluated from left to right:

1. `(A || B)` is evaluated. It's true if either A or B is true.
2. `(D && E)` is evaluated because it's a nested expression. It's true if D and E are both true.
3. The outer expression `(C || (D && E))` is evaluated. It's true if D and E are both true or C is true.

Lastly, the && operation outside of the parentheses is evaluated: `(A || B) && (C || (D && E))`

The formula evaluates to true if at least one of A or B is true and either C is true or both D and E are true.