Supported Functions

Browse through the list of built-in supported functions.

Math Functions

ABS

This function returns the absolute value of the provided number.

= ABS(-12.5)

ATAN

This function returns the arctangent of the provided vertical and horizontal components of a vector.

= ATAN(45, 45)

AVERAGE

This function returns the average of the provided list of numeric values.

= AVERAGE(A2:A5)

CEILING

This function returns the smallest integer greater than or equal to the provided numeric value.

= CEILING(6.2)

CHOICE

This function returns a random value from the provided list of values.

= CHOICE(10, 20, 30)

COS

This function returns the cosine of the provided numeric value.

= COS(45)

EXP

This function returns the result of raising e to the power of the provided numeric value.

= EXP(12)

FLOOR

This function returns the largest integer less than or equal to the provided numeric value.

= FLOOR(10.8)

HYPOT

This function returns the hypotenuse of the provided horizontal and vertical components of a vector.

= HYPOT(45, 45)

LOG

This function returns the natural logarithm of the provided numeric value.

= LOG(15)

MAX

This function returns the maximum value from the provided list of numeric values.

= MAX(A2:A5)

MIN

This function returns the minimum value from the provided list of numeric values.

= MIN(A2:A5)

NORM

This function returns a random number from a normal distribution with a mean of 0 and a standard deviation of 1.

= NORM()

PI

This function returns the value of pi.

= PI()

POWER

This function returns the result of raising the first argument to the power of the second argument.

= POWER(2, 3)

PRODUCT

This function returns the product of the provided list of numeric values.

= PRODUCT(A2:A5)

RADIANS

This function converts the provided angle in degrees to radians.

= RADIANS(180)

RAND

This function returns a random floating point number between 0 and 1.

= RAND()

RANDBETWEEN

This function returns a random integer between the two provided values. The first argument is the minimum value and the second argument is the maximum value.

= RANDBETWEEN(5, 12)

ROUND

This function returns the provided numeric value rounded to the specified number of decimal places.

= ROUND(10.583, 2)

SIGN

This function returns the sign of the provided numeric value. Returns 1 if the value is positive, -1 if the value is negative, and 0 if the value is zero.

= SIGN(10)

SIN

This function returns the sine of the provided numeric value.

= SIN(45)

SQRT

This function returns the square root of the provided numeric value.

= SQRT(9)

STDDEV

This function returns the standard deviation of the provided list of numeric values.

= STDDEV(A2:A5)

SUM

This function returns the sum of the provided list of numeric values.

= SUM(A2:A5)

TAN

This function returns the tangent of the provided numeric value.

= TAN(45)

Logical Functions

AND

This function returns true if all of the provided arguments are true. Otherwise, it returns false.

= AND(10 > 20, TRUE)

IF

This function returns one of two values based on the provided condition. If the condition is true, the first argument is returned. Otherwise, the second argument is returned.

= IF(10 > 20, "Yes", "No")

OR

This function returns true if at least one of the provided arguments is true. Otherwise, it returns false.

= OR(10 > 20, FALSE)

Range Functions

COUNT

This function returns the number of numeric values in the provided list of values.

= COUNT(A2:A5)

COUNTIF

This function returns the number of values in the provided list that are equal to the provided value.

= COUNTIF(A2:A5, TRUE)

INDEX

This function returns a value from the list of values at the provided index

= INDEX(A2:A5, 2)

MATCH

This function returns the index of the provided value in the provided list. If the value is not found, it returns -1.

= MATCH("ID", A2:A5)

Text Functions

CONCAT

This function returns a concatenated string of the provided list of values.

= CONCAT("Hello", "World", "!")

LEFT

This function returns the left part of the provided string. The first argument is the string and the second argument is the number of characters to return.

= LEFT("Hello", 5)

LEN

This function returns the length of the provided string.

= LEN("Hello")

MID

This function returns the middle part of the provided string. The first argument is the string, the second argument is the starting index, and the third argument is the number of characters to return.

= MID("Hello", 1, 5)

RIGHT

This function returns the right part of the provided string. The first argument is the string and the second argument is the number of characters to return.

= RIGHT("Hello", 5)

Special Functions

DATASET

This function retrieves the imported dataset using its key, more specifically the values of the corresponding column.

= DATASET("bitcoin", "price")

KEYHOLD

This function is used for user interaction using the keyboard while the simulation is running. This function returns true if the provided key is pressed. This function returns true in all steps, up until the key is released.

= KEYHOLD("A")

KEYPRESS

This function is used for user interaction using the keyboard while the simulation is running. The function returns true if the provided key is pressed. This function returns true only in the step it was pressed in and its subsequent press requires to release it first.

= KEYPRESS("A")

Simulation Functions

STEP

This function returns the current step of the simulation.

= STEP()

Convert Functions

BOOLEAN

This function converts the provided value as a boolean.

= BOOLEAN("TRUE")

NUMBER

This function converts the provided value as a number.

= NUMBER("10")

Graph Functions

ASPECTRATIO

This function renders the provided image using the specified aspect ratio.

= ASPECTRATIO("none", "image.png")

AXES

This function draw axes around a given shape. The string parameter can be any string containing the words left, right, bottom and/or top, for example using space as a separator.

= AXES("bottom right", B5)

BAR

This function renders a rectangle for use in a bar chart. It creates a rectangle that fills the whole area for a given categorical value and has a specified width.

= BAR(50, "Germany")

BUBBLE

This function renders a bubble at the specified point. The last two parameters specify the width and height of the bubble in pixels.

= BUBBLE(POINT(50, 50), 20, 20)

CATEGORICAL

This function returns a categorical scale that can contain categorical values specified in the given array of strings.

= CATEGORICAL("red", "green", "blue")

COLUMN

This function renders a filled rectangle for use in a column chart. It creates a rectangle that fills the whole area for a given categorical value and has a specified height.

= COLUMN("apple", 75)

CONTINUOUS

This function returns a continuous scale that can contain value in the specified range.

= CONTINUOUS(10, 20)

COORD

This function returns a categorical coordinate. It accepts either a string and a number, or a number and a string.

= COORD("population", 10)

FILLCOLOR

This function is used to specify the color of the provided graph.

= FILLCOLOR("RED", B5)

FONT

This function is used to specify the font of the provided graph.

= FONT("Arial", "BLACK", B5)

GRAPH

This function converts the provided graph object into an inline graph displayed inside the spreadsheet cell.

= GRAPH(B5)

IMAGE

This function loads the image from the provided URL and renders it inside the boundaries specified by the the POINT values.

= IMAGE("image.png", POINT(10, 10), POINT(50, 50))

LINE

This function renders a line specified by the provided array of points

= LINE(POINT(1, 10), POINT(2, 15), POINT(3, 5))

NEST

This function creates a shape that occupies an explicitly specified space using the four coordinates as left and right X value and top and bottom Y values. Inside this explicitly specified space, the nested shape is drawn, using its own scales.

= NEST(POINT(10, 10), POINT(50, 50), B5)

NESTX

Same as with the NEST function, but this primitive only overrides the X scale of the nested shape while the Y scale is left unchanged and can be shared with other shapes.

= NESTX(50, 75, B5)

NESTY

Same as with the NEST function, but this primitive only overrides the Y scale of the nested shape while the X scale is left unchanged and can be shared with other shapes.

= NESTY(50, 75, B5)

OVERLAY

This function composes the given array of shapes by drawing them all in the same chart area. This calculates the scale of all nested shapes and those are then automatically aligned based on their coordinates.

= OVERLAY(B1, B2, B3)

PADDING

This function adds a padding around the given shape. The padding is specified as top, right, bottom, left. This will subtract the padding from the available space and draw the nested shape into the smaller space.

= PADDING(10, 10, 10, 10, B5)

POINT

This function creates a point specified by the provided x and y coordinates. The point object can be used e.g. in composing line charts.

= POINT(10, 20)

SCALE

This function overrides the automatically inferred scale with an explicitly specified one. You can use this to define a custom minimal and maximal value. To create scales use either CONTINUOUS or CATEGORICAL functions.

= SCALE(CONTINUOUS(0, 100), CONTINUOUS(25, 50), B5)

SCALEX

Same as with the scale function, but overrides the automatically inferred X scale.

= SCALEX(CONTINUOUS(0, 100), B5)

SCALEY

Same as with the scale function, but overrides the automatically inferred Y scale.

= SCALEY(CONTINUOUS(25, 50), B5)

SHAPE

This function creates a generic shape specified by the provided array of points.

= SHAPE(POINT(10, 10), POINT(20, 20), POINT(15, 15))

STROKECOLOR

This function is used to specify the stroke color of the provided graph.

= STROKECOLOR("RED", B5)

TEXT

This function renders the provided text string at the specified point.

= TEXT(POINT(10, 20), "Hello, World!")