[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.Expressions.OperatorKind

OperatorKind Enum

Specifies the operator used in a formula syntax tree.

Use this enum with OperatorNode to represent arithmetic, comparison, reference, text-concatenation, and dynamic-array operators when building or inspecting parsed formulas.

Namespace: GrapeCity.Documents.Excel.Expressions
Assembly: DS.Documents.Excel.dll
Syntax
public enum OperatorKind : byte
Public Enum OperatorKind As Byte
Examples
FormulaSyntaxTree syntaxTree = new FormulaSyntaxTree();
OperatorNode rootNode = new OperatorNode(OperatorKind.Multiply);
syntaxTree.Root = rootNode;

Reference reference = new Reference();
reference.Row = 0;
reference.Column = 0;
reference.LastRow = 7;
reference.LastColumn = 4;
reference.IsRowRelative = false;
reference.IsColumnRelative = true;
reference.IsLastRowRelative = false;
reference.IsLastColumnRelative = true;

rootNode.Children.Add(new ReferenceNode(reference));
rootNode.Children.Add(new NumberNode(9));

UnParseContext context = new UnParseContext();
context.IsR1C1 = true;
string formulaText = syntaxTree.ToString(context);

Fields

Name Description
Addition

Represents the + operator.

The + operator has the primary purpose of adding two numbers. This operator is defined only for double operands, and it always narrows its operands to double.

Syntax:
expression1 + expression2 or +expression2

Parts:
expression1: Optional. Any numeric or string expression.
expression2: Required. Any numeric or string expression.

Concatenate

Represents the & operator.

Concatenation operators join multiple strings into a single string. The & operator is defined only for string operands, and it always widens its operands to string.

Syntax:
expression1 & expression2

Parts:
expression1: Required. Any expression with a data type that widens to String.
expression2: Required. Any expression with a data type that widens to String.

Division

Represents the / operator.

Divides two numbers and returns a floating-point result, including any remainder.

The QUOTIENT function returns the integer quotient and drops the remainder.

Syntax:
expression1 / expression2

Parts:
expression1: Required. Any numeric or string expression.
expression2: Required. Any numeric or string expression.

Equality

Represents the = operator.

The equality operator compares two expressions to determine whether or not they are equal.

Syntax:
expression1 = expression2

Parts:
expression1: Required. Any expression.
expression2: Required. Any expression.

Exponent

Represents the ^ operator.

Raises a number to the power of another number, always as a double value.

Syntax:
number ^ exponent

Parts:
number: Required. Any numeric or string expression.
exponent: Required. Any numeric or string expression.

GreaterThan

Represents the > operator.

The greater than operator compares two expressions to determine whether the left side is greater than the right side.
Syntax:
expression1 > expression2
Parts:
expression1: Required. Any expression.
expression2: Required. Any expression.

GreaterThanOrEqual

Represents the >= operator.

The greater than or equal operator compares two expressions to determine whether the left side is greater than or equal to the right side.
Syntax:
expression1 >= expression2
Parts:
expression1: Required. Any expression.
expression2: Required. Any expression.

Inequality

Represents the <> operator.

Intersection

Represents the (space) operator.

The intersection operator gives a reference to the cells that are common to two range arguments.

Syntax:
range1 range2
Parts:
range1: Required. Must be a range expression.
range2: Required. Must be a range expression.

LessThan

Represents the < operator.

The less than operator compares two expressions to determine whether the left side is less than the right side.
Syntax:
expression1 < expression2
Parts:
expression1: Required. Any expression.
expression2: Required. Any expression.

LessThanOrEqual

Represents the <= operator.

Multiply

Represents the * operator.

Multiplies two numeric expressions and returns their product.

Syntax:
expression1 * expression2

Parts:
expression1: Required. Any numeric or string expression.
expression2: Required. Any numeric or string expression.

Percentage

Represents the % operator.

Divides a numeric expression by 100 and returns the result as a percentage value.
Syntax:
expression1%
Parts:
expression1: Required. Any numeric or string expression that can be converted to a number.

Range

Represents the : operator.

The range operator returns a reference to all cells between the start and end reference cells, including both endpoints.
Syntax:
range1:range2
Parts:
range1: Required. Must be a range expression.
range2: Required. Must be a range expression.

Single

Represents the @ operator.

Spill

Represents the # operator.

Refers to the entire spill range from the specified cell.
Syntax:
expression#
Parts:
expression: Required. Any cell reference expression.

Subtraction

Represents the - operator.

Returns the difference between two numeric expressions or the negative value of a numeric expression.
Syntax:
expression1 - expression2 or -expression2
Parts:
expression1: Optional. Any numeric or string expression.
expression2: Required. Any numeric or string expression.

Union

Represents the , operator.

The union operator combines two or more references into a single reference.

Syntax:
range1,range2
Parts:
range1: Required. Must be a range expression.
range2: Required. Must be a range expression.