-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Supported functions
Grid supports some of the functions that you may find in other spreadsheet applications such as Microsoft Excel or Google Sheets.
Currently, the following functions are supported:
SUM(value, ...)
- sum values
Example: SUM(A1:A10) or SUM(A1,A2)
AVERAGE(value, ...)
- take the mathematical average (mean)
Example: AVERAGE(A1:A10) or AVERAGE(A1,A2)
IF(logical-value, value, value)
- if logical function
Example: IF(A1 > 2, 1, 0) or IF(A1 == "random", RAND(), 1)
MATHC(string)
- get a mathematical constant
Example: MATHC("pi") or MATHC("e") or MATHC("π") - currently only π and e are in MATHC
SQRT(number)
- take square root of a number
Example: SQRT(A1) or SQRT(2)
CONCATENATE(string-value)
or CONCAT(string-value)
- concatenate string values
Example: CONCAT("Hello, ", "World!")
NUMBER(value)
- converts a value to a number
Example: NUMBER("0123") = 123
LEN(value)
- get the length of the string representation of a value
Example: LEN("abcd") = 4 or LEN(100) = 3
COUNT(values)
- get the amount cells that contain a value
Example: COUNT(A1:A10) = 4 (if 4 cells are non-empty)
RAND()
- get a random number between 0 and 1
Example: RAND() = 0.92892480103
FLOOR(number)
- take the floor of a number
Example: FLOOR(1.9) = 1
CEIL(number)
- take the ceil of a number
Example: CEIL(1.1) = 2
ABS(number)
- take the absolute value of a number
Example: ABS(-12.1) = 12.1
VLOOKUP(value, lookup_range, column_index)
- look up a value based on a key value
Example: VLOOKUP(A1, Sheet2!$A$1:$D$100, 4) - look up the value in A1 in column Sheet2!A1 and return the result in the 4th column (D).
OLS(y_range, x1_range, x2_range, ...)
- Perform a linear regression with form y ~ x1 + x2 + ...
Example: OLS(A1:A10, B1:B10, C1:C10) with for example A1:A10 containing house prices, B1:B10 containing square meter count and C1:C10 counting city dummy variable