# Create Expressions

## Content



Expression Editor enables creating and editing complex expressions at run-time. It provides Excel-like formulas, in the form of functions as well as operators and constants that help in shaping data using expressions.

To create expressions, use any of the following ways:

*   Simply begin typing within the text box of C1ExpressionEditor. The control can convert the typed string to an expression.
*   Select from the available list of functions and operators from C1ExpressionEditorPanel.


> type=note
> Note that variables are enclosed in square brackets [\].

Some examples of creating expressions using in-built functions and operators are as follows.

| **Using Logical and Aggregate Functions** | **Description** |
| --- | --- |
| Iif([Price\] + [Cost\]) > 500,300,400) | This expression evaluates the two constants 300 and 400 based on the condition provided by the expression "([Price\] + [Cost\]) > 500".<br /> |
| IsNull([Sales\]) | This expression evaluates whether Sales are null. |
| **Using DateTimeFunctions** | **Description** |
| AddDays([OrderDate\], 30) | This expression adds the number of days equivalent to integer value 30 to the OrderDate value of the type DateTime. |
| DateDiffDay([DateStart\], [DateEnd\]) | This expression counts the number of days between DateStart and DateEnd. |
| **Using Math Functions** | **Description** |
| Sign([Value\]) | This expression returns the integer value indicating the sign of the provided Value. |
| Exp([Value\]) | This expression calculates and returns the base of natural logarithms raised to the power Value. |
| **Using String Functions** | **Description** |
| Mid([Name\],0,4) | This expression returns a string of specified number of 4 characters from the beginning of the specified [Name\] string. |
| Remove([Name\], 0, 3) | This expression removes specified number of 3 characters from the beginning of the string specified as 0. |

## See Also

[Built-in Functions, Operators, and Constants](/componentone/docs/wpf/online-expressioneditor-core/functions-operators)