Getting Started
Lucid rounds out its shape data capabilities by offering formulas to users. Similar to the way spreadsheet tools allow users to analyze, adjust, and quantify their data, Lucid allows users to run certain formulas on their visual diagrams and associated metadata.
Metadata can be added to shapes in various ways, including linking data from spreadsheets, or adding custom data. Custom data can contain static values, or formulas. To add custom data to a shape, group, or page, simply select that shape and open the data panel. In the data panel, there is a section labeled "Custom Data." Click on the + button to add a custom data value. You can rename it, add a value to the property, an even insert that value onto the shape as text by clicking the +T button that appears when you hover over the property name or value.
Explore below to see a wide variety of formulas that are available and details for how they work.
The content on this page is subject to the Developer Terms of Service.
Syntax
Types
Generally, there are five different types that can be used in the Lucid formula system: strings, numbers, booleans, arrays and objects. Additionally, there are built-in constants (such as
String
Strings are text values that represent a sequence of characters. For example, "Hello, World", "Test", 'Demo123' are all examples of strings. Strings are constructed by paired single (') or double (") quote characters. A string is started with one of the quote characters and is terminated with the same quote character. If a string is uncompleted, the formula will be invalid.
Within a string, the same quote character can be included without stopping the string by doubling the character. Newlines can be added to a formula string in the editor by press shift+enter to add a line break; the line must still be terminated with a matching quote character, however.
Example | Result |
---|---|
"Joe said, ""Hello, World""." | Joe said, "Hello, World". |
'It isn''t correct' | It isn't correct |
"It isn't correct" | It isn't correct |
'A B' |
A B |
Number
Numbers are numeric values that can be integers (-1, 0, 2, etc.) or decimal numbers (0.25, 1.234, etc.). Numbers should not include commas for place separators (for example, 1,000,000 is not a valid number).
Numbers can be defined using scientific notation, which defines the number as a factor and a power of 10. Scientific notation is in the form MeN, which translates into the value (M × 10N). For example, 1.23e4 translates into the value 12300.
Numbers can also be defined as percentages by adding a percent sign at the end (for example, 1.23%). The value used for calculations will be divided by 100 (for 1.23%, the value 0.0123 would be used), but the percentage will correctly display as a percentage in the data property editor.
Example | Result |
---|---|
1234 | 1234 |
1.23e4 | 12300 |
1.23% | 0.0123 (displayed as 1.23%) |
Boolean
Booleans are either true or false and are used in boolean logic (for example, functions like
Array
Arrays are an ordered collection of values indexed by contiguous integers. More details can be found here
Object
Objects are structures that contains key-value pairs. More details can be found here
Built-In Constants
In the Lucid formula system, some predefined constants can be used to simplify formula writing.
Constant | Value | Description |
---|---|---|
E | 2.718281828459045 | The mathematical constant e, which represents the base of the natural logarithm |
PI | 3.141592653589793 | The mathematical constant pi. Useful when performing trigonometric functions, such as |
NONE | undefined | Returns undefined |
Operators
In the above formula, the "*" character represents a multiplication operator, and when used multiples the values together. In the example, the expression 0.5 *
Arithmetic Operators
Operator | Examples | Description |
---|---|---|
+ | 1 + 2 @A + 2 @B + @C |
Addition |
- | 1 - 2 @A - 2 @B - @C -3 -@A |
Subtraction or negation |
* | 1 * 2 @A * 2 @B * @C |
Multiplication |
/ | 1 / 2 @A / 2 @B / @C |
Division |
^ | 1 ^ 2 @A ^ 2 @B ^ @C |
Exponentiation |
Comparison Operators
Operator | Examples | Description |
---|---|---|
< | 1 < 2 @A < 2 @B < @C |
Less than |
<= | 1 <= 2 @A <= 2 @B <= @C |
Less than or equal to |
= | 1 = 2 @A = 2 @B = @C |
Equal to |
>= | 1 >= 2 @A >= 2 @B >= @C |
Greater than or equal to |
> | 1 > 2 @A > 2 @B > @C |
Greater than |
<> | 1 <> 2 @A <> 2 @B <> @C |
Not equal |
Text Concatenation Operators
Operator | Examples | Description |
---|---|---|
& | "A" & "B" @A & "C" "D" & @B & @C |
Text concatenation. Combines two string together into a single string, for example "Lucid" & "chart" produces the string "Lucidchart". |
References
In the above formula, the "@Value" gets the value of the shape data property "Value". If the shape we are using has a property named "Value" which has the value 5, then the expression above is equivalent to:
References can be used to access shape data properties from other shapes, such as the page or shape contained in the current shape's group.
Functions
Functions are operations that expect 0 or more parameters and produce some kind of output. In the above example, the function is named
The value of
Some functions take no parameters, and can be used by themselves (with or without parentheses). For example, the
Advanced Syntax
Lambdas
Some functions require the user to specify an expression to evaluate for each item in an array parameter (for example,
In this expression, the
The expression to evaluate in this case is called a lambda, and comes in the form of:
name above tells the expression what to call each item in
In this formula, the
Nesting Lambdas
Lambdas can also be nested, for example if a function which expects a lambda parameter calls a function which itself expects a lambda in its lambda. When nesting functions that take lambdas, using different names for each lambda helps to ensure that each item can be referenced uniquely.
Consider the following formula:
In this formula, the
-
MAP is called on [1, 2, 3] - For each item in the array:
- x = 1:
-
FILTER returns the array [1, 2, 3, 4] filtered to only include items above x (1), which is [2, 3, 4]
-
- x = 2:
-
FILTER return the array filtered to only include items above x (2), which is [3, 4]
-
- x = 3:
-
FILTER return the array filtered to only include items above x (3), which is [4]
-
- No more items are in array, so the loop stops, returning each item found above as an array: [[2, 3, 4], [3, 4], [4]].
- x = 1:
Shape References
CHILDREN
Gets info about all the child elements of the current item.
If you are in page data, then "children" is all items, including groups, shapes, lines and layers on the page.
If you are inside a group shape or on a layer, then "children" is all shapes within the group or layer.
Syntax
Examples
In the following examples, the selected shape is a group with 4 shapes in it, with the following text and values:
Text | Property 1 | Property 2 |
---|---|---|
Shape 1 | 1 | 10 |
Shape 2 | 4 | 18 |
Shape 3 | 2 | |
Shape 4 | 6 | 14 |
The array of all children of the current shape.
NOTE: In the example above, the "Property 2" shape data does not exist for shape "Shape 3", so no data is included in the resulting array.
CONNECTED
Get a list of references to all shapes that are connected directly to the current shape, via a line.
Syntax
Examples
In the following examples, the selected shape is Shape 2
Text | Property 1 | Property 2 |
---|---|---|
Shape 1 | 1 | 10 |
Shape 2 | 4 | 18 |
Shape 3 | 2 | 13 |
Shape 4 | 6 | |
Shape 5 | 8 | 12 |
CONNECTEDDEEP
Get a list of references to all shapes that are connected to the current shape, via a line, as well as all shapes connected to the connected shapes, etc.
Syntax
Examples
In the following examples, the selected shape is Shape 2
Text | Property 1 | Property 2 |
---|---|---|
Shape 1 | 1 | 10 |
Shape 2 | 4 | 18 |
Shape 3 | 2 | 13 |
Shape 4 | 6 | |
Shape 5 | 8 | 12 |
DESCENDANTS
Get info about all descendants of current object: children, and children of children, etc.
Syntax
Examples
In the following examples, the selected shape is a group with 6 shapes in it, with the following text and values
Text | Property 1 | Property 2 |
---|---|---|
Shape 1 | 1 | 10 |
Shape 2 | 4 | 18 |
Shape 3 | 2 | 13 |
Shape 4 | 6 | |
Shape 5 | 7 | 14 |
Group 6 | 8 |
"Group 6" is a group with 2 shapes in it, with the following text and values
Text | Property 1 | Property 2 |
---|---|---|
Shape 7 | 5 | 12 |
Shape 8 | 10 | 15 |
DOWNSTREAM
Gets a list of references to all shapes TO which a line has been drawn FROM the current shape
For example, for two shapes A and B, if a line is drawn from A to B, then B is upstream of A. If another shape C is added, and a line is drawn from B to C, then C is upstream of B. If another shape D is added, and a line is drawn from D to B, then B is upstream of D.
Syntax
Examples
In the following examples, the selected shape is Shape 2
Text | Property 1 | Property 2 |
---|---|---|
Shape 1 | 1 | 10 |
Shape 2 | 4 | 18 |
Shape 3 | 2 | 13 |
Shape 4 | 6 | |
Shape 5 | 8 | 12 |
DOWNSTREAMDEEP
Gets a list of references to all shapes TO which a line has been drawn FROM the current shape, as well as all shape from that are upstream from those shapes, etc.
Syntax
Examples
In the following examples, the selected shape is Shape 2
Text | Property 1 | Property 2 |
---|---|---|
Shape 1 | 1 | 10 |
Shape 2 | 4 | 18 |
Shape 3 | 2 | 13 |
Shape 4 | 6 | |
Shape 5 | 8 | 12 |
PAGE
A reference to the page. Allows fast access to the page data values.
Syntax
Examples
PARENT
Gets info about the parent element of the current item.
If you are in page data, then there is no parent.
If you are in a shape or group shape that is on the page, then the page is the parent.
If you are in a shape or group shape that is on a layer, then the layer is the parent.
If you are in a shape or group shape that is inside a group shape, then the group shape is the parent..
Syntax
Examples
SIBLINGS
Gets info about all the sibling elements of the current item. Siblings are all elements that are children of the item's parent, excluding the item itself.
If you are in page data, then "siblings" is an empty array.
Syntax
Examples
In the following examples, the selected shape is Shape 2, which is contained in a group with 4 shapes in it, with the following text and values:
Text | Property 1 | Property 2 |
---|---|---|
Shape 1 | 1 | 10 |
Shape 2 | 4 | 18 |
Shape 3 | 2 | |
Shape 4 | 6 | 14 |
The array of all children of the current shape.
NOTE: In the example above, the "Property 2" shape data does not exist for shape "Shape 3", so no data is included for that shape in the resulting array.
THIS
A reference to a shape itself. It is primarily used to get things on the shape or to reference it. When it is used without referencing items on the shape, it will return the text of the shape.
Syntax
Examples
Given that a shape has the following data:
Label | Value |
---|---|
Property 1 | Process |
UPSTREAM
Gets a list of references to all shapes FROM which a line has been drawn TO the current shape
For example, for two shapes A and B, if a line is drawn from A to B, then A is upstream of B. If another shape C is added, and a line is drawn from B to C, then B is upstream of C. If another shape D is added, and a line is drawn from D to B, then D is upstream of B.
Syntax
Examples
In the following examples, the selected shape is Shape 4
Text | Property 1 | Property 2 |
---|---|---|
Shape 1 | 1 | 10 |
Shape 2 | 4 | 18 |
Shape 3 | 2 | 13 |
Shape 4 | 6 | |
Shape 5 | 8 | 12 |
UPSTREAMDEEP
Gets a list of references to all shapes FROM which a line has been drawn TO the current shape, as well as all shape from that are upstream from those shapes, etc.
Syntax
Examples
In the following examples, the selected shape is Shape 4
Text | Property 1 | Property 2 |
---|---|---|
Shape 1 | 1 | 10 |
Shape 2 | 4 | 18 |
Shape 3 | 2 | 13 |
Shape 4 | 6 | |
Shape 5 | 8 | 12 |
Data References
@
A reference to a shape itself. It is primarily used to get things on the shape or to reference it. When it is used without referencing items on the shape, it will return the text of the shape.
Syntax
Examples
Given that a shape has the following data:
Label | Value |
---|---|
Property 1 | Process |
FIELDLOOKUP
Uses a reference key and the collection name to find a data property.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
collection | String | The name of the collection to reference |
data | String | The shape data property to reference |
key | String | The key value to find within the data |
Examples
INDEX
Returns the value at a given position from an array, starting from 1.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
array | Array | The array of values from which to retrieve a value |
index | Number | The position within the array to get the value |
Examples
In the following examples, the selected shape is a group with 4 shapes in it, with the following text and values:
Text | Property 1 | Property 2 |
---|---|---|
Shape 1 | 1 | 10 |
Shape 2 | 4 | 18 |
Shape 3 | 2 | |
Shape 4 | 6 | 14 |
LABEL
Gets the unique shape identifier for the current shape.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
shape | Reference | The item reference |
Examples
LOOKUP / COLLECTION
Finds data from a collection using a reference key and returns an array of all the data associated with that reference key.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
collection | String | The name of the collection to reference |
key | String | (Optional) The reference key for the collection |
Examples
Shape Properties
ITEMTYPE
Gets the type of the current item or the specified item(s). Item type is one of: Line, Block, Group, Page.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
items | Reference or Array | The item or items to return item types for |
Examples
SHAPEACTIONS
Gets all actions added to the current shape or specified shape(s). Shape actions are objects with an action type value and additional values specific to the type of action.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
shapes | Reference or Array | The shape or shapes for which to retrieve shape actions |
Output
Shape actions can be one of the following types:
- url
- toggle-layer
- hide-layer
- show-layer
- page
- document
- conditionalformatting
URL Shape Actions
URL shape actions have the
Field | Type | Description |
---|---|---|
url | String | URL specified in the web/email action |
Page Shape Actions
Page shape actions have the
Field | Type | Description |
---|---|---|
page | Reference | The page specified in the page action |
Document Shape Actions
Document shape actions have the
Field | Type | Description |
---|---|---|
document | String | The document ID specified in the document action |
Toggle Layer, Show Layer, and Hide Layer Shape Actions
Layer shape actions have a type of
Field | Type | Description |
---|---|---|
layers | Array | An array of references to layers specified in the action |
Conditional Formatting Shape Actions
Conditional formatting shape actions have the
Field | Type | Description |
---|---|---|
rules | Array | An array of conditional formatting rule names specified in the action |
Examples
SHAPETYPE
Gets the specific type of shape for the current shape or the specified shape(s).
Syntax
Arguments
Argument | Type | Description |
---|---|---|
shapes | Reference or Array | The shape or shapes to return shape types for |
Examples
Document Properties
CREATEDTIME
Gets the creation date and time of the document.
Syntax
Examples
CREATORNAME
Gets the name of the creator of the document.
Syntax
Examples
DOCUMENTNAME
Gets the current name of the document.
Syntax
Examples
DOCUMENTSTATUS
Gets the current approval status of the document.
Syntax
Examples
LASTMODIFIEDBY
Gets the name of the user who last modified the document.
Syntax
Examples
LASTMODIFIEDTIME
Gets the last modified date and time of the document.
Syntax
Examples
Logical Statements
AND
Returns true if all of the given expressions/values are true, and false otherwise
Syntax
Arguments
Argument | Type | Description |
---|---|---|
exprN | Boolean | The value to use |
Examples
COALESCE
Returns the first non-empty value, or NONE if all values are empty. A value is non-empty if
Syntax
Arguments
Argument | Type | Description |
---|---|---|
exprN | String, Array or Object | Any value. The first non-empty value will be returned |
Examples
IF
Checks the value of an expression and returns a specified value if the expression is true, and returns a different value if not.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
expr | Boolean | The expression to evaluate when determining which value to return |
resultTrue | Any | The value to return if the expression evaluates to true |
resultFalse | Any | The value to return if the expression evaluates to false |
Examples
IFERROR
Checks if the expression has an error and, returns a replacement value, if so, or the original value otherwise.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
expression | Any | The expression to evaluate for errors |
replacement | Any | The value to return if the expression evaluation resulted in an error |
Examples
IFS
Returns the first matching condition from a list of conditions and corresponding results.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
condition | Boolean | The conditions to check |
result | Any | The result for the corresponding condition |
Examples
ISEMPTY
Returns true if the expression is empty.
- Strings passed into the function are checked if they are an empty string.
- If an array is passed into the function, the function will return true only if every item in the flattened array is equal to the empty string.
- If a value that is not a string or array is passed into the function, the value will be converted to a string before checking if the value is an empty string.
- If an object is passed into the function, the function will return true only if the object has no keys.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
expr | String, Array or Object | The value to check for emptiness |
Examples
ISNOTEMPTY
Returns true if the expression is not empty.
- Strings passed into the function are checked if they are not an empty string.
- If an array is passed into the function, the function will return true only if every item in the flattened array is not equal to the empty string.
- If a value that is not a string or array is passed into the function, the value will be converted to a string before checking if the value is not an empty string.
- If an object is passed into the function, the function will return true only if the object has keys.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
expr | String, Array or Object | The value to check for emptiness |
Examples
NOT
Returns true if the given expression/values is false, and false if the given expression is true
Syntax
Arguments
Argument | Type | Description |
---|---|---|
exprN | Boolean | The value to use |
Examples
OR
Returns true if any of the given expressions/values are true, and false otherwise
Syntax
Arguments
Argument | Type | Description |
---|---|---|
exprN | Boolean | The value to use |
Examples
RAND
Returns a random value between 0 and 1 (inclusive of 0, exclusive of 1).
Syntax
Example
RANDBETWEEN
Returns a random integer between min and max (inclusive).
Syntax
Arguments
Argument | Type | Description |
---|---|---|
min | Number | The minimum value that the random integer can be |
max | Number | The maximum value that the random integer can be |
Example
SRAND
Returns a seeded random value between 0 (inclusive) and 1 (exclusive).
Syntax
Arguments
Argument | Type | Description |
---|---|---|
seed | Number | Value to seed random value |
Examples
SRANDBETWEEN
Returns a seeded random integer between min and max (inclusive).
Syntax
Arguments
Argument | Type | Description |
---|---|---|
seed | Number | Value to seed random value |
min | Number | Min value of range |
max | Number | Max value to range |
Examples
SWITCH
Returns the first matching value from a list of values and corresponding results with a specified value.
The
Syntax
Arguments
Argument | Type | Description |
---|---|---|
test | Any | The test value to check against each value |
value | Any | The value to compare against the test value. |
result | Any | The result for the corresponding value. |
default | Any | (Optional) The default value to return if no values match the test value. |
Examples
Analytical
COUNT
Counts the number of elements in the specified array.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
value | Array | An array of values to count |
Examples
COUNTDEEP
Recursively counts the numbers of elements in the specified array.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
value | Array or Any | Any value to count, which can be an array, reference or a single value. |
Examples
COUNTIF
Counts the number of elements in an array that meet the specified condition
Syntax
Arguments
Argument | Type | Description |
---|---|---|
array | Array | Any value to count, which can be an array, reference or a single value |
expression | Boolean | The expression to evaluate for each item in the flattened array, to determine whether it should be counted or not |
Examples
COUNTIFDEEP
Recursively counts the number of elements in the specified array which satisfy the given condition.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
array | Array | Any value to count, which can be an array, reference or a single value |
expression | Boolean | The expression to evaluate for each item in the flattened array, to determine whether it should be counted or not |
Examples
FILTER
Returns a filtered list of items from a specified array that match a specified condition.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
array | Array | The array to filter |
expression | Boolean | The expression to evaluate for each item in the flattened array, to determine whether it should be counted or not |
Examples
FILTERDEEP
Returns a recursively filtered list of items from a specified array that match a specified condition.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
array | Array | The array to filter |
expression | Boolean | The expression to evaluate for each item in the flattened array, to determine whether it should be counted or not |
Examples
MAX
Calculates the maximum value of specified numbers.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
number | Number or Array | A number or array of numbers to find the maximum of |
Examples
MEAN
Calculates the mean (average) of specified numbers.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
number | Number or Array | A number or array of numbers to average |
Examples
MIN
Calculates the minimum value of specified numbers.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
number | Number or Array | A number or array of numbers to find the minimum of |
Examples
SORT
Sorts the specified list using an optional sort order and expression to control the ordering.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
array | Array | The array to sort |
order | String | (Optional) Ascending or descending order. Should be one of "ASC" or "DESC" |
expression | Any | (Optional) An expression that, when evaluated, is used to sort the array |
Examples
SUM
Calculates the arithmetic sum (total) of all specified numbers.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
number | Number or Array | A number or array of numbers to sum |
Examples
Type Checks
ISARRAY
Returns true if the specified value is an array.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
value | Any | The value to test |
Examples
ISBOOLEAN
Returns true if the value is a boolean value (true or false).
Syntax
Arguments
Argument | Type | Description |
---|---|---|
value | Any | The value to test |
fuzzy | Boolean | Specify whether the test should allow conversion |
Examples
ISCOLOR
Returns true if the specified value is a color value.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
value | Any | The value to test |
fuzzy | Boolean | Specify whether the test should allow conversion |
Examples
ISDATE
Returns true if the specified value is a date value.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
value | Any | The value to test |
fuzzy | Boolean | Specify whether the test should allow conversion |
Examples
ISERROR
Returns true if the provided expression results in an error.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
expression | Any | The expression to test |
Examples
ISNOTERROR
Returns true if the provided expression does not result in an error.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
expression | Any | The expression to test |
Examples
ISNUMBER
Returns true if the specified value is a number value
Syntax
Arguments
Argument | Type | Description |
---|---|---|
value | Any | The value to test |
fuzzy | Boolean | Specify whether the test should allow conversion |
Examples
ISOBJECT
Returns true if the specified value is an object value.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
value | Any | The value to test |
Examples
ISTEXT / ISSTRING
Returns true if the specified value is a text value.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
value | Any | The value to test |
Examples
String/Number Checks
BETWEEN
Checks if a number is between two other numbers, inclusive. Returns true if the number is between the specified numbers, and false if it is not between those numbers.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
value | Number | The value to test |
low | Number | The value to use for the low side of the inclusive range |
high | Number | The value to use for the high side of the inclusive range |
Examples
CONTAINS
Returns true if a property or string contains a value, and returns false otherwise.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
haystack | String or Array | The value to look for the needle in |
needle | Any | The value to search for in the haystack |
Examples
DOESNOTCONTAIN
Returns true if a property or string does not contain a value, and returns false otherwise.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
haystack | String or Array | The value to look for the needle in |
needle | Any | The value to search for in the haystack |
Examples
ENDSWITH
Returns true if a property or string ends with a value, and returns false otherwise.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
value | String | The value to check for the ending string |
test | String | The value to look for |
Examples
ISEVEN
Returns true if the specified number is even and false if the number is odd.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
number | Number | The number to test |
Examples
ISODD
Returns true if the specified number is odd and false if the number is even.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
number | Number | The number to test |
Examples
NOTBETWEEN
Checks if a number is not between two other numbers, inclusive. Returns true if the number is not between the specified numbers, and false if it is between those numbers.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
value | Number | The value to test |
low | Number | The value to use for the low side of the inclusive range |
high | Number | The value to use for the high side of the inclusive range |
Examples
STARTSWITH
Returns true if a property or string starts with a value, and returns false otherwise.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
value | String | The value to check for the starting string |
test | String | The value to look for |
Examples
String Manipulation
&
Text concatenation. Combines two strings together into a single string. For example "Lucid" & "chart" produces the string "Lucidchart".
Examples
CHAR / UNICHAR
Get a string from the given character code or codes.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
input | Number | Character code |
Examples
CODE / UNICODE
Convert a unicode string into their corresponding code point or points.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
string | String | Characters to decode |
Examples
CONCATENATE
Creates a new string by combining all specified strings into a single string
Syntax
Arguments
Argument | Type | Description |
---|---|---|
string | String | The strings to combine |
Examples
FIND
Returns the position in the specified string of a substring, starting at the specified start position.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
needle | String | The string to find |
haystack | String | The string to search in |
start | Number | (Optional) The index in the haystack to start searching. Defaults to 1 |
Examples
LEFT
Returns the specified number of characters from the start of the string.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
string | String | The string to get characters from |
count | Number | The number of characters to get |
Examples
LEN
Returns the length of the string.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
string | String | The string to find the length of |
Examples
LOWER
Returns the specified string converted to lower-case.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
string | String | The string to convert |
Examples
REGEX_MATCHALL
Returns all matches in the specified string found by the supplied regex.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
regex | String | The regex to use when looking for matches |
string | String | The string to look for matches in |
Examples
REGEX_REPLACE
Returns a new string created by replacing all matches in the specified string using the regex and a replacement string.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
regex | String | The regex to use when looking for matches |
string | String | The string to look for matches in |
replacement | String | The string to replace all found matches with |
Examples
REGEX_TEST
Returns true if the specified string is matched by the supplied regex.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
regex | String | The regex to use when looking for matches |
string | String | The string to look for matches in |
Examples
REPLACE
Splices a string into the specified string, replacing the characters in the original string from a range of characters.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
string | String | The specified string |
start | Number | The index of the specified string in which to start the replacement |
count | Number | The number of characters to replace |
replacement | String | The string to splice into the specified string |
Examples
REPT
Repeats a string a number of times.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
string | String | The specified string |
repetitions | Number | The number of times to repeat the string |
Examples
RIGHT
Returns the specified number of characters from the end of the string.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
string | String | The string to get characters from |
count | Number | The number of characters to get |
Examples
SEARCH
Returns the position of the specified search string, starting at an optional start position. Start index can be negative. Allows the wildcard characters ? (to match any single character) and * (to match one or more characters). A ~ before the ? or * character (e.g. "?" or "*") matches the specific character "?" or "*".
Syntax
Arguments
Argument | Type | Description |
---|---|---|
needle | String | The string to find. The string can contain the wildcard characters ? or * |
haystack | String | The string to search in |
start | Number | (Optional) The index in the haystack to start searching. Defaults to 1 |
Examples
SPLIT
Splits the specified string into an array at the specified separator.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
string | String | The string to split into an array |
separator | String | Character at which to split the string |
Examples
SUBSTITUTE
Replaces a string with another string in a specified string. If an instance number is specified, only substitutes the instance-th match.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
string | String | The string to do substitutions within |
old | String | The existing string to replace |
new | String | The new string to use during replacing |
instance | Number | (Optional) Instance found in which substitution occurs |
Examples
SUBSTRING / MID
Returns the specified number of characters from a string, starting at the specified start position.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
string | String | The string to get characters from |
start | Number | The starting index in the string |
count | Number | The number of characters to return |
Examples
TRIM
Returns a string where all whitespace characters (spaces, tabs, newlines, etc.) have been removed from both the start and end of the specified string.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
string | String | The string to trim whitespace characters from |
Examples
TRUNCATE
Returns the string truncated to the specified number of characters, with an ellipsis added at the end if truncation occurred.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
string | String | The string to truncate |
length | Number | Desired length |
Examples
UPPER
Returns the specified string converted to upper-case.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
string | String | The string to convert |
Examples
Number Manipulation
ABS
Calculates the absolute value of the specified number.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
value | Number | The value to calculate the absolute value of |
Examples
ASNUMBER
Converts a value into a number.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
value | String or Currency | The value to convert to a number |
Examples
ASPERCENT
Formats a number as a percentage. The percentage is calculated as 100 times the number; for example, 0.25 will be formatted as 25%.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
value | Number | The number to format as a percentage |
Examples
CEIL
Rounds up (to a lesser absolute value) to the nearest multiple of the specified factor. Defaults to a factor of 1.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
value | Number | The value to round up |
factor | Number | (Optional) Specified factor |
Examples
CLAMP
Limits a value to a specified minimum and maximum value range. If the specified value is below the minimum value or above the maximum value, the minimum value or maximum value, respectively, is returned.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
value | Number | The value to clamp |
min | Number | The minimum value |
max | Number | The maximum value |
Examples
EXP
Calculates the value of Euler's constant (e) raised to the specified value. Equivalent to evalue.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
value | Number | The value used as the exponent for e |
Examples
FLOOR
Rounds down (to a lesser absolute value) to the nearest multiple of the specified factor. Defaults to a factor of 1.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
value | Number | The value to round down |
factor | Number | (Optional) Specified factor |
Examples
FORMAT_NUMBER
Returns a string representing the number, formatted according to the given pattern.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
value | Number | The value to format |
pattern | String | The pattern to format by |
Examples
LERP / INTERPOLATE
Calculates the linearly interpolated value between two numbers, with a specified proportion.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
value | Number | The interpolation value. Value must be between 0 and 1 (values outside of the range will be constrained to that range). |
a | Number | The first value to interpolate between. |
b | Number | The second value to interpolate between. |
Examples
LN
Calculates the natural log of the specified number
Syntax
Arguments
Argument | Type | Description |
---|---|---|
value | Number | The value used to calculate the natural log. Must be greater than 0. |
Examples
LOG / LOG10
Calculates the base 10 logarithm of the specified number
Syntax
Arguments
Argument | Type | Description |
---|---|---|
value | Number | The value used to calculate the base 10 logarithm. Must be greater than 0. |
Examples
MOD / MODULUS
Calculates the modulus of a specified number with a specified divisor. The resulting value is the remainder after division of the value by the divisor.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
value | Number | The value to modulo |
divisor | Number | The divisor of the modulo operation. Cannot be 0. |
Examples
NUMBER_PARSE
Liberally parses the first number in an input string.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
input | String | The string to parse a number from |
Examples
POW / POWER
Calculates the value of the specified number raised to a given exponent
Syntax
Arguments
Argument | Type | Description |
---|---|---|
base | Number | The base to be raised to the exponent power |
exponent | Number | The exponent |
Examples
PRODUCT
Calculates the product of a list of numbers or arrays of numbers.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
value | Number or Array | The values used to calculate the product. Allows either numbers or arrays, which can themselves contain numbers or arrays. |
Examples
ROUND
Rounds a number to specified number of digits.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
value | Number | The value to round |
digits | Number | (Optional) The number of digits to round the value, defaults to 0 |
Examples
ROUNDDOWN
Rounds a number down (to a lesser value) to the specified number of digits.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
value | Number | The value to round |
digits | Number | (Optional) The number of digits to round the value, defaults to 0 |
Examples
ROUNDUP
Rounds a number up (to a greater value) to the specified number of digits.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
value | Number | The value to round |
digits | Number | (Optional) The number of digits to round the value, defaults to 0 |
Examples
SIGN
Calculates the sign of the specified number as -1, 0, or 1, depending on whether the specified number is negative, zero, or positive, respectively
Syntax
Arguments
Argument | Type | Description |
---|---|---|
value | Number | The value to calculate sign |
Examples
SQRT / SQUAREROOT
Returns the square root of a number.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
value | Number | The value used to calculate the square root |
Examples
TRUNC
Calculates the value of the specified number with its fractional component removed. The TRUNC function does not perform any rounding.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
value | Number | The value to truncate |
Examples
Arrays
ASARRAY
If the argument is not an array, returns an array containing the argument. Otherwise, returns the argument array.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
value | Any | The value to be returned as an array |
Examples
ARRAY
Creates an array of all supplied values
Syntax
Arguments
Argument | Type | Description |
---|---|---|
value | Any | The value for the specified item, values can be different types |
Examples
DIFFERENCE
Takes two arrays, treated as sets (i.e. ignoring duplicate values), and returns a new array that contains all items from the first array that are not in the second array.
Syntax
Examples
FLATARRAY / FLATTEN
Creates an array of all supplied values, flattening any arrays so that the array is a single array of values.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
value | Any | The value for the specified item, values can be different types |
Examples
IN
Returns a boolean indicating if a specified item (needle) is inside of a given set (haystack). Note that the haystack must be an array.
Syntax
Examples
INTERSECT
Takes two arrays, treated as sets (i.e. ignoring duplicate values), and returns a new array that contains only items that are contained in both. If the input arrays have no items in common, returns an empty array.
Syntax
Examples
JOIN
Creates a string from array elements connected by a specified separator.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
array | Array | Array of elements to convert to a string |
separator | String | String separator to use when combining elements |
Examples
MAP
Transforms each value of the specified array into a new value using a formula.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
array | Array | Array of elements |
expression | Lambda | Transformation to perform on each item of the array |
Examples
RANGE
Creates an array of numbers with values ranging from the start number to the end number, by repetitively adding the step value to calculate values.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
start | Number | The starting value for the range |
end | Number | The ending value for the range |
step | Number | (Optional) The step to use to calculate the subsequent numbers for the range, defaults to 1 |
Examples
REVERSE
Reverses the order of an array.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
array | Array | The array of values to reverse |
Examples
SHUFFLE
Randomly shuffles the values in the given array.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
array | Array | The array of values to shuffle |
Examples
UNION
Takes two arrays, treated as sets (i.e. ignoring duplicate values), and returns a new array that contains all distinct items from both inputs.
Syntax
Examples
UNIQUE
Takes either a single array or a list of values and returns an array which contains each distinct value only once. In other words it turns either an array or a list of values into a set.
Syntax
Examples
ZIP
Combines the items in several input arrays by putting the first item from each array into the first output array, the second item from each array into the second output array, and so on. Specifically, given n arrays of at least m values each, returns an array of m arrays of n values each, where the ith value in the jth output array is the jth value in the ith input array.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
array | Array | Array of items to combine |
Examples
ZIPALL
Combines the items in several input arrays by putting the first item from each array into the first output array, the second item from each array into the second output array, and so on, using the default value for any missing items. Specifically, given n arrays of as many as m values each, returns an array of m arrays of n values each, where the ith value in the jth output array is the jth value in the ith input array or a default value.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
array | Array | Array of items to combine |
default | Any | Default value to use for any missing items |
Examples
Dates
CURRENTSECOND
The current time's seconds field.
Syntax
Examples
DATE
Creates a date from the specified values.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
year | Number | The year for the new date |
month | Number | (Optional) The month for the new date, defaults to 1 (January) |
day | Number | (Optional) The day for the new date, defaults to 1 |
hours | Number | (Optional) The hours for the new date, defaults to 0 (midnight) |
minutes | Number | (Optional) The minutes for the new date, defaults to 0 |
seconds | Number | (Optional) The seconds for the new date, defaults to 0 |
milliseconds | Number | (Optional) The milliseconds for the new date, defaults to 0 |
offset | Number | (Optional) The timezone offset for the new date, in minutes, defaults to the browser's current timezone offset |
Examples
In the following examples, the current browser has a timezone offset of -7 hours. For more information about offsets see UTC Offset.
DATEADD
Creates a new date by adding an offset to a specified date.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
interval | String | The type of interval to find the difference of Valid intervals are:
|
count | Number | The number of intervals to add to the specified date |
date | Date | The date to add intervals to |
Examples
DATEDIFF
Calculates the difference between two specified dates in the given interval. If date2 is before date1, then the result will be negative.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
interval | String | The type of interval to find the difference of Valid intervals are:
|
date1 | Date | The starting date |
date2 | Date | The ending date |
Examples
DAY
Gets the day component of the specified date.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
date | Date | The date to use for calculation |
Examples
DAYOFWEEK
Calculates the day of the week (1-7) for a specified date where the week starts on Monday.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
date | Date | The date to use for calculation |
Examples
DAYSAGO
Gets the number of days between the specified date and now.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
date | Date | The date to use for calculation |
Examples
The following examples assume the current date is January 2, 2020 at 12:00pm
EXCELDATE
Creates a date from a numeric Excel date value assuming the value is stored as the number of days since Dec 30, 1899 (where 1 is 12/31/1899).
Syntax
Arguments
Argument | Type | Description |
---|---|---|
value | Number | The number of days since Dec 30, 1899 |
Examples
FORMAT_DATE
Returns a string representing the date, formatted according to the given pattern. Pattern formatting is generally the same as supported by Excel.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
date | Date | The date to format |
pattern | String | The pattern by which to format the date |
Examples
HOUR
Gets the hour component of the specified date.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
date | Date | The date to use for calculation |
Examples
HOURSAGO
Gets the number of hours between the specified date and now.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
date | Date | The date to use for calculation |
Examples
The following examples assume the current date is January 2, 2020 at 12:00pm
ISODATE
Creates a date from an ISO8601-formatted string. See ISO8601 formatting for more details.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
value | String | ISO8601-formatted string |
Examples
In the following examples, the current browser has a timezone offset of -7 hours. For more information about offsets see UTC Offset.
MINUTE
Gets the minute component of the specified date.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
date | Date | The date to use for calculation |
Examples
MINUTESAGO
Gets the number of minutes between the specified date and now.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
date | Date | The date to use for calculation |
Examples
The following examples assume the current date is January 2, 2020 at 12:00pm
MONTH
Gets the month component of the specified date.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
date | Date | The date to use for calculation |
Examples
MONTHSAGO
Gets the number of months between the specified date and now.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
date | Date | The date to use for calculation |
Examples
The following examples assume the current date is January 2, 2020 at 12:00pm
NETWORKDAYS
Gets the number of working days between a specified beginning and ending date, inclusive. Working days exclude weekends and any dates optionally provided as holidays.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
start | Date | The beginning date to use for the calculation |
end | Date | The end date to use for the calculation |
holidays | Array(Date) | (Optional) Dates to exclude from the count of working days |
Examples
NOW
Returns the current date and time. Automatically updates every second.
Syntax
Examples
QUARTER
Gets the calendar quarter for the specified date. For more details see Quarters.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
date | Date | The date to use for calculation |
Examples
SECOND
Gets the second component of the specified date.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
date | Date | The date to use for calculation |
Examples
SECONDSAGO
Gets the number of seconds between the specified date and now.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
date | Date | The date to use for calculation |
Examples
The following examples assume the current date is January 2, 2020 at 12:00pm
UNIXDATE
Creates a date from the number of seconds since the Unix epoch (January 1, 1970, 00:00:00 UTC).
Syntax
Arguments
Argument | Type | Description |
---|---|---|
value | Number | number of seconds |
Examples
UTCDATE
Creates a date from the specified values.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
year | Number | The year for the new date |
month | Number | (Optional) The month for the new date, defaults to 1 (January) |
day | Number | (Optional) The day for the new date, defaults to 1 |
hours | Number | (Optional) The hours for the new date, defaults to 0 (midnight) |
minutes | Number | (Optional) The minutes for the new date, defaults to 0 |
seconds | Number | (Optional) The seconds for the new date, defaults to 0 |
milliseconds | Number | (Optional) The milliseconds for the new date, defaults to 0 |
Examples
In the following examples, the current browser has a timezone offset of -7 hours. For more information about offsets see UTC Offset.
WEEK
Gets the week component of the specified date. For more information see ISO Week Date.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
date | Date | The date to use for calculation |
Examples
WEEKSAGO
Gets the number of weeks between the specified date and now.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
date | Date | The date to use for calculation |
Examples
The following examples assume the current date is January 2, 2020 at 12:00pm
WEEKYEAR
Gets the year for the associated ISO week of the specified date. For more information see ISO Week Date.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
date | Date | The date to use for calculation |
Examples
WORKDAY
Given a start date, finds the date a specified number of working days later. A list of holidays can optionally be provided, indicating the given dates are not working days.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
start | Date | The beginning date to use for the calculation |
workdays | Number | The number of working days to add to the start date |
holidays | Array(Date) | (Optional) Dates to exclude from the count of working days |
Examples
YEAR
Gets the year component of the specified date.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
date | Date | The date to use for calculation |
Examples
YEARSAGO
Gets the number of years between the specified date and now.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
date | Date | The date to use for calculation |
Examples
The following examples assume the current date is January 2, 2020 at 12:00pm
Currency
CURRENCY
Creates a currency from the specified amount and type, defaulting to USD if the type isn't specified.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
value | Number | Amount of currency |
type | String | (Optional) The type of currency, defaults to USD. List of options found here |
Examples
CURRENCYADD
Creates a new currency by adding two currencies of the same type together.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
currency | Currency | Amount |
Examples
CURRENCYDIFF
Calculates the difference between two specified currencies of the same type.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
currency | Currency | Amount |
Examples
CURRENCYMULT
Creates a new currency by multiplying a currency by a number.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
currency | Currency | Amount |
value | Number | Value to multiply currency by |
Examples
Objects
GET
Gets the associated value from an object for the specified key.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
obj | Object | The object to use. |
key | String | The key to use within the object, will be converted to a string type if the value given is a non-string |
Examples
In these examples, the shape data property "Object" is an object with the following key-value pairs:
GROUPBY
Creates an object from an array and a key expression which determines the key for each item, and a value expression which determines the value.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
array | String | The array to use. |
keyExpression | Any | The expression which determines which key to use for the item in the array. |
valueExpression | Array | The expression which determines which value to use for the item in the array. |
Examples
For these examples, the shape data property "Array" is an array with the values:
HAS
Returns true if the object or reference has a value with the specified key.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
obj | Any | The object or reference to test |
key | String | The key to look for |
Examples
KEYS
Return the array of strings which will can be referenced using GET() on the parameter. Defaults to
Syntax
Arguments
Argument | Type | Description |
---|---|---|
obj | Any | The object or reference to test |
Example
OBJECT
Creates an object that can be queried by key. Arguments are passed in as either an array of key-value pairs or as paired key and value parameters.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
keyN | String | The key for the key-value pair. If the key is a non-string it will be converted to a string type |
valueN | Any | The value for the specified key. Values can be different types |
keyvalues | Array | An array of key-value pairs. Each element in the array should be an array with two values, the first representing the key and the second representing the value. |
Examples
VALUES
Returns the dereferenced values of all keys available on the specified parameter. Defaults to
Syntax
Arguments
Argument | Type | Description |
---|---|---|
obj | Any | The object or reference to test |
Examples
Smart Containers
CONTAINER
Gets the container that contains the selected item in a Smart Container.
Syntax
Examples
CONTENTS
Gets the contents of the selected Smart Container.
Syntax
Examples
Trigonometric
ACOS
Calculates the inverse cosine of the specified number (arccosine), in radians.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
value | Number | The cosine value, in the range (-1, 1) |
Examples
ACOSH
Calculates the inverse hyperbolic cosine of the specified number.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
value | Number | The value which must be greater than 1 |
Examples
ACOT
Calculates the inverse cotangent of the specified number (arccotangent), in radians.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
value | Number | The cotangent value |
Examples
ACOTH
Calculates the inverse hyperbolic cotangent of the specified number.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
value | Number | The value, must not be in the range (-1, 1) |
Examples
ASIN
Calculates the inverse sine of the specified number (arcsine), in radians.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
value | Number | The sine value |
Examples
ASINH
Calculates the inverse hyperbolic sine of the specified number.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
value | Number | The value |
Examples
ATAN
Calculates the inverse tangent of the specified number (arctangent), in radians.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
value | Number | The tangent value |
Examples
ATAN2
Calculates the inverse tangent of the specified x- and y-coordinates (arctangent).
The arctangent is calculated as the angle (in radians) from the x-axis to a line containing the origin (0, 0) and the point (x, y).
Syntax
Arguments
Argument | Type | Description |
---|---|---|
x | Number | The x-coordinate |
y | Number | The y-coordinate |
Examples
ATANH
Calculates the inverse hyperbolic tangent of the specified number.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
value | Number | The value, in the range (-1, 1) |
Examples
COS / COSINE
Calculates the cosine, using the specified angle in radians.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
angle | Number | The angle in radians |
Examples
COSH
Calculates the hyperbolic cosine of the specified angle, in radians.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
angle | Number | The angle in radians |
Examples
COT
Calculates the cotangent, using the specified angle in radians.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
angle | Number | The angle in radians |
Examples
DEGREES
Converts the specified angle from radians to degrees.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
angle | Number | The angle in radians |
Examples
RADIANS
Converts the specified angle from degrees to radians.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
angle | Number | The angle in degrees |
Examples
SIN / SINE
Calculates the sine, using the specified angle in radians.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
angle | Number | The angle in radians |
Examples
SINH
Calculates the hyperbolic sine of the specified angle, in radians.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
angle | Number | The angle in radians |
Examples
TAN / TANGENT
Calculates the tangent, using the specified angle in radians.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
angle | Number | The angle in radians |
Examples
TANH
Calculates the hyperbolic tangent of the specified angle, in radians.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
angle | Number | The angle in radians |
Examples
Color Creation
HEXCOLOR
Creates a new color from the specified hexadecimal color string.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
hexstring | String | The hex color string, in the form #RRGGBBAA or #RRGGBB |
Examples
=HEXCOLOR("#00ff00")
=HEXCOLOR("#f96b1388")
HSL / HSLA
Creates a new color from the specified hue, saturation, lightness and alpha values.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
hue | Number | The hue value, from 0 to 255 |
saturation | Number | The saturation value, from 0 to 255 |
lightness | Number | The lightness value, from 0 to 255 |
alpha | Number | (Optional) The alpha value, a decimal value from 0 to 1 |
Examples
=HSLA(0, 1, 0.5, 1)
=HSLA(0, 1, 1, 0.5)
HSV / HSVA
Creates a new color from the specified hue, saturation, value and alpha values.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
hue | Number | The hue value, from 0 to 255 |
saturation | Number | The saturation value, from 0 to 255 |
value | Number | The value value, from 0 to 255 |
alpha | Number | (Optional) The alpha value, a decimal value from 0 to 1 |
Examples
=HSVA(0, 0.5, 1, 1)
=HSVA(110, 0.5, 0.5, 0.5)
RGB / RGBA
Creates a new color from the specified red, green, blue and alpha values.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
red | Number | The red value, from 0 to 255 |
green | Number | The green value, from 0 to 255 |
blue | Number | The blue value, from 0 to 255 |
alpha | Number | (Optional) The alpha value, a decimal value from 0 to 1 |
Examples
=RGBA(0, 255, 0, 0.5)
=RGBA(0, 128, 0, 1)
Color Values
ALPHA
Gets the alpha channel of the specified color. Returns a decimal from 0 to 1.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
color | Color | The color |
Examples
BLUE
Gets the blue channel of the specified color in the RGB colorspace. Returns an integer from 0 to 255.
For more information about the RGB colorspace, see: https://en.wikipedia.org/wiki/RGB
Syntax
Arguments
Argument | Type | Description |
---|---|---|
color | Color | The color |
Examples
GREEN
Gets the green channel of the specified color in the RGB colorspace. Returns an integer from 0 to 255.
For more information about the RGB colorspace, see: https://en.wikipedia.org/wiki/RGB
Syntax
Arguments
Argument | Type | Description |
---|---|---|
color | Color | The color |
Examples
HSVHUE
Gets the hue channel of the specified color in the HSV colorspace. Returns an integer from 0 to 360.
For more information about hue, see: https://en.wikipedia.org/wiki/Hue
Syntax
Arguments
Argument | Type | Description |
---|---|---|
color | Color | The color |
Examples
HSVSATURATION
Gets the saturation channel of the specified color in the HSV colorspace. Returns a decimal number from 0 to 1.
For more information about hue, see: https://en.wikipedia.org/wiki/HSL_and_HSV#Saturation
Syntax
Arguments
Argument | Type | Description |
---|---|---|
color | Color | The color |
Examples
HSVVALUE
Gets the value channel of the specified color in the HSV colorspace. Returns a decimal from 0 to 1.
For more information about value, see: https://en.wikipedia.org/wiki/HSL_and_HSV#Hue_and_chroma
Syntax
Arguments
Argument | Type | Description |
---|---|---|
color | Color | The color |
Examples
HUE
Gets the hue channel of the specified color in the HSL colorspace. Returns an integer from 0 to 360.
For more information about hue, see: https://en.wikipedia.org/wiki/Hue
Syntax
Arguments
Argument | Type | Description |
---|---|---|
color | Color | The color |
Examples
LIGHTNESS
Gets the lightness channel of the specified color in the HSL colorspace. Returns a decimal number from 0 to 1.
For more information about hue, see: https://en.wikipedia.org/wiki/HSL_and_HSV#Lightness
Syntax
Arguments
Argument | Type | Description |
---|---|---|
color | Color | The color |
Examples
LUMINANCE
Calculates the luma (perceptual brightness) of the specified color. Uses SMPTE C / Rec. 709 coefficients, as recommended in WCAG 2.0.
For more information, see: https://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
Syntax
Arguments
Argument | Type | Description |
---|---|---|
color | Color | The color |
Examples
RED
Gets the red channel of the specified color in the RGB colorspace. Returns an integer from 0 to 255.
For more information about the RGB colorspace, see: https://en.wikipedia.org/wiki/RGB
Syntax
Arguments
Argument | Type | Description |
---|---|---|
color | Color | The color |
Examples
SATURATION
Gets the saturation channel of the specified color in the HSL colorspace. Returns a decimal number from 0 to 1.
For more information about hue, see: https://en.wikipedia.org/wiki/HSL_and_HSV#Saturation
Syntax
Arguments
Argument | Type | Description |
---|---|---|
color | Color | The color |
Examples
Color Operations
CONTRAST
Determines which of the two specified colors has a higher contrast against the given color.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
color | Color | The color to use when determining contrast. |
dark | Color | (Optional) The dark color to use. Default to black. |
light | Color | (Optional) The light color to use. Default to white. |
threshold | Number | (Optional) The percentage threshold specifying where the transition from dark to light is. Defaults to 0.43 |
Examples
=CONTRAST("#00ff00"
=CONTRAST("#ff0000"
DARKEN
Creates a new color from the specified color by decreasing the lightness in the HSL color space.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
color | Color | The color to darken. |
amount | Number | The percentage amount to darken the given color, from 0 to 1. |
Examples
=DARKEN("#ffffff"
=DARKEN(RGB(0, 255, 0)
DESATURATE
Creates a new color from the specified color by decreasing the saturation in the HSL color space.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
color | Color | The color to desaturate. |
amount | Number | The percentage amount to desaturate the given color, from 0 to 1. |
Examples
=DESATURATE("#bf4040"
FADE
Creates a new color from the specified color by setting the opacity to a specific value.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
color | Color | The color to fade. |
amount | Number | The opacity value, from 0 to 1. |
Examples
=FADE("#0000ffff"
FADEIN
Creates a new color from the specified color by increasing the opacity.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
color | Color | The color to fade in. |
amount | Number | The percentage amount to increase opacity the given color, from 0 to 1. |
Examples
=FADEIN("#00ff0088"
FADEOUT
Creates a new color from the specified color by decreasing the opacity.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
color | Color | The color to fade out. |
amount | Number | The percentage amount to decrease opacity the given color, from 0 to 1. |
Examples
=FADEOUT("#00ff0088"
GRAYSCALE / GREYSCALE
Creates a new color from the specified color by removing all saturation in the HSL color space.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
color | Color | The color to convert to grayscale. |
Examples
=GRAYSCALE("#00ff00"
=GRAYSCALE("#1071e5"
LIGHTEN
Creates a new color from the specified color by increasing the lightness in the HSL color space.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
color | Color | The color to lighten. |
amount | Number | The percentage amount to lighten the given color, from 0 to 1. |
Examples
=LIGHTEN("#000000"
=LIGHTEN(RGB(0, 255, 0)
MIX
Creates a new color by combining two specified colors in a given proportion.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
color1 | Color | The first color to mix. |
color2 | Color | The second color to mix. |
amount | Number | The percentage amount to lighten the given color, from 0 to 1. |
Examples
=MIX("#00ff00"
=MIX("#00ff00"
SATURATE
Creates a new color from the specified color by increasing the saturation in the HSL color space.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
color | Color | The color to change saturation. |
amount | Number | The percentage amount to saturate the given color, from 0 to 1. |
Examples
=SATURATE("#bf4040"
SHADE
Creates a new color by mixing the specified color with black in a given proportion.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
color | Color | The color to shade. |
amount | Number | The percentage balance point between the given color and black, from 0 to 1. |
Examples
=SHADE("#00ff00"
SPIN
Creates a new color from the specified color by rotating the hue in the HSL color space.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
color | Color | The color to spin. |
amount | Number | The number of degrees to rotate the hue for the given color, from 0 to 360. |
Examples
=SPIN("#00ff00"
TINT
Creates a new color by mixing the specified color with white in a given proportion.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
color | Color | The color to tint. |
amount | Number | The percentage balance point between the given color and white, from 0 to 1. |
Examples
=TINT("#00ff00"
Color Blending
BLENDMULTIPLY
Creates a new color by multiplying the corresponding RGB channels of the specified colors, resulting in a darker color.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
color1 | Color | The first color to blend |
color2 | Color | The second color to blend |
Examples
=BLENDMULTIPLY("#0080ff"
=BLENDMULTIPLY("#ffffff"
BLENDSCREEN
Creates a new color by inverting and then multiplying the corresponding RGB channels of the specified colors, resulting in a lighter color.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
color1 | Color | The first color to blend |
color2 | Color | The second color to blend |
Examples
=BLENDSCREEN("#0080ff"
=BLENDSCREEN("#2080d0"
BLENDOVERLAY
Creates a new color from the two provided by performing an overlay blend, making light colors lighter and dark colors darker.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
color1 | Color | The first color to blend |
color2 | Color | The second color to blend |
Examples
=BLENDOVERLAY("#2080d0"
=BLENDOVERLAY("#0080ff"
BLENDSOFTLIGHT
Creates a new color by performing a soft light blend.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
color1 | Color | The first color to blend |
color2 | Color | The second color to blend |
Examples
=BLENDSOFTLIGHT("#2080d0"
=BLENDSOFTLIGHT("#0080ff"
BLENDHARDLIGHT
Creates a new color by performing a hard light blend.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
color1 | Color | The first color to blend |
color2 | Color | The second color to blend |
Examples
=BLENDHARDLIGHT("#2080d0"
=BLENDHARDLIGHT("#0080ff"
BLENDDIFFERENCE
Creates a new color by subtracting one provided color from the other.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
color1 | Color | The first color to blend |
color2 | Color | The second color to blend |
Examples
=BLENDDIFFERENCE("#00ffff"
BLENDEXCLUSION
Creates a new color by performing an exclusion blend.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
color1 | Color | The first color to blend |
color2 | Color | The second color to blend |
Examples
=BLENDEXCLUSION("#0080ff"
=BLENDEXCLUSION("#0080ff"
BLENDAVERAGE
Blends the two provided colors by averaging the respective values in each channel.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
color1 | Color | The first color to blend |
color2 | Color | The second color to blend |
Examples
=BLENDAVERAGE("#00ff00"
BLENDNEGATION
Creates a new color from the two provided using a negation function.
Syntax
Arguments
Argument | Type | Description |
---|---|---|
color1 | Color | The first color to blend |
color2 | Color | The second color to blend |
Examples
=BLENDNEGATION("#1180f0"
=BLENDNEGATION("#00ffff"