Numeric Functions
This page is a quick reference for the numeric functions in NocoDB formula fields. Each function has a short description, its syntax and a sample.
ABS
The ABS function returns the distance of a number from zero. The result is never negative.
Syntax
ABS(number)Sample
ABS(10.35) => 10.35
ABS(-15) => 15ADD
The ADD function returns the sum of the numbers in its arguments.
Syntax
ADD(number1, [number2, ...])Sample
ADD(5, 7) => 12
ADD(-10, 15, 20) => 25AVG
The AVG function returns the mean of a set of numbers.
Syntax
AVG(number1, [number2, ...])Sample
AVG(10, 20, 30) => 20
AVG(-5, 5) => 0CEILING
The CEILING function rounds a number up to the nearest integer that is equal to or greater than the number.
Syntax
CEILING(number)Sample
CEILING(8.75) => 9
CEILING(-15.25) => -15COUNT
The COUNT function returns the number of numeric arguments.
Syntax
COUNT(number1, [number2, ...])Sample
COUNT(1, 2, "abc", 3) => 3
COUNT(-5, 0, "$abc", 5) => 3COUNTA
The COUNTA function returns the number of arguments that are not empty.
Syntax
COUNTA(value1, [value2, ...])Sample
COUNTA(1, "", "text") => 2
COUNTA("one", "two", "three") => 3COUNTALL
The COUNTALL function returns the total number of arguments. It counts numeric and non-numeric arguments.
Syntax
COUNTALL(value1, [value2, ...])Sample
COUNTALL(1, "", "text") => 3
COUNTALL("one", "two", "three") => 3EVEN
The EVEN function rounds a number to the nearest even number:
- It rounds a positive number up.
- It rounds a negative number down.
Syntax
EVEN(number)Sample
EVEN(7) => 8
EVEN(-5) => -6EXP
The EXP function returns 'e' raised to the power of the number.
Syntax
EXP(number)Sample
EXP(2) => 7.38905609893065
EXP(-1) => 0.36787944117144233FLOOR
The FLOOR function rounds a number down to the nearest integer.
Syntax
FLOOR(number)Sample
FLOOR(8.75) => 8
FLOOR(-15.25) => -16INT
The INT function removes the decimal part of a number. It returns the integer part.
Syntax
INT(number)Sample
INT(8.75) => 8
INT(-15.25) => -15LOG
The LOG function returns the logarithm of a number to a project. The default project is e.
Syntax
LOG([base], number)Sample
LOG(10, 100) => 2
LOG(2, 8) => 3MAX
The MAX function returns the highest value in a set of numbers.
Syntax
MAX(number1, [number2, ...])Sample
MAX(5, 10, 3) => 10
MAX(-10, -5, -20) => -5MIN
The MIN function returns the lowest value in a set of numbers.
Syntax
MIN(number1, [number2, ...])Sample
MIN(5, 10, 3) => 3
MIN(-10, -5, -20) => -20MOD
The MOD function divides one number by another number (integer division). It returns the remainder.
Syntax
MOD(number1, number2)Sample
MOD(10, 3) => 1
MOD(-15, 4) => -3ODD
The ODD function rounds a number to the nearest odd number:
- It rounds a positive number up.
- It rounds a negative number down.
Syntax
ODD(number)Sample
ODD(6) => 7
ODD(-5.5) => -7POWER
The POWER function raises a project to an exponent.
Syntax
POWER(base, exponent)Sample
POWER(2, 3) => 8
POWER(10, -2) => 0.01ROUND
The ROUND function rounds a number to a number of decimal places (precision). The default precision is 0.
Syntax
ROUND(number, [precision])Sample
ROUND(8.765, 2) => 8.77
ROUND(-15.123, 1) => -15.1ROUNDDOWN
The ROUNDDOWN function rounds a number down to a number of decimal places (precision). The default precision is 0.
Syntax
ROUNDDOWN(number, [precision])Sample
ROUNDDOWN(8.765, 2) => 8.76
ROUNDDOWN(-15.123, 1) => -15.2ROUNDUP
The ROUNDUP function rounds a number up to a number of decimal places (precision). The default precision is 0.
Syntax
ROUNDUP(number, [precision])Sample
ROUNDUP(8.765, 2) => 8.77
ROUNDUP(-15.123, 1) => -15.1SQRT
The SQRT function returns the square root of a number.
Syntax
SQRT(number)Sample
SQRT(25) => 5
SQRT(2) => 1.4142135623730951VALUE
The VALUE function gets the numeric value from a string. It handles % and - first.
Syntax
VALUE(text)Sample
VALUE("123$") => 123
VALUE("USD -45.67") => -45.67Last updated on