Operator
Supported Operators
The document model supports four groups of operators: arithmetic, comparison, text, reference, and dynamic array.
|
Arithmetic Operators | |
|---|---|
|
Addition (1+2) |
|
Subtraction (2-1) or negation (-1) |
|
Multiplication (2*2) |
|
/ (Forward slash) |
Division (5/2) |
|
% (Percent sign) |
Percent (10%) |
|
^ (Caret) |
Exponentiation (5^2) |
|
Comparison Operators | |
|---|---|
|
= |
Equal to (A1=3) |
|
|
Greater than (A1>4) |
|
< |
Less than (A1<5) |
|
Greater than or equal to (A1>=6) |
|
<= |
Less than or equal to (A1<=7) |
|
<> |
Not equal to (A1<>8) |
|
Concatenation Operator | |
|---|---|
|
& (Ampersand) |
Concatenates text values ("Rad"&"Spreadsheet") |
|
Reference Operator | |
|---|---|
|
: (Colon) |
Produces a reference to a range of cells between two specified cells, including these two cells. (A1:C3) |
|
, (Space) |
Intersection operator. Returns a reference to the cells that two ranges have in common. (A1:C3 B2:C2) |
Operator Precedence
If you combine multiple operators in a single formula, the document model evaluates the expression in the order determined by the precedence of the operators. If two operators have equal precedence, the document model evaluates them from left to right. The following table contains all operators sorted by precedence in descending order:
|
: (Colon) , (Space) |
Reference Operators |
|
Negation (-2) |
|
^ (Caret) |
Exponentiation |
|
Multiplication and division |
|
Addition and subtraction |
|
& (Ampersand) |
Concatenates two strings |
|
= (Equal)
< (Less than)
<= (Less than or equal to) <> (Not equal) |
Comparison operators |
Use parentheses to change the order of operations within an expression.
Dynamic Array Operators
Two additional operators support dynamic array formulas. For a full description of dynamic array behavior, see Dynamic Array Formulas.
| Dynamic Array Operator | |
|---|---|
|
@ (At sign) |
Implicit intersection operator. Unary prefix operator with the highest precedence. Resolves an array or range expression to a single value based on the row and column position of the formula cell. Example: =@A1:A10 returns the value in the row that intersects the formula cell. In XLSX, stored as |
|
# (Hash sign) |
Spill range operator. Postfix operator that follows a cell reference. Resolves to the entire spill range owned by the anchor cell at that reference. Example: =SUM(A1#) sums the spill range starting at A1. Returns #REF! if the referenced cell is not a spill anchor. In XLSX, stored as |