Math Functions
A math function performs mathematical calculations. Use Math functions with Numeric data types only.
ABS
ABS(x)
: Returns the absolute value of a number (x). It's the distance between 0 and a number. The value is always positive.
Example
ABS(32)
returns 32.
ABS(-32)
returns 32.
ACOS
ACOS(x)
: Returns the arccosine, or inverse cosine, of a number (x).
Returns the arccosine, or inverse cosine, of a number. The arccosine is the angle whose cosine is (x).
- The returned angle is given in radians in the range 0 (zero) to pi.
- The number (x) must be between -1 and 1.
Example
ACOS(0.5)
returns 1.047198.
ASIN
ASIN(x)
: Returns the arcsine, or inverse sine, of a number (x).
Returns the arcsine, or inverse sine, of a number. The arcsine is the angle whose sine is (x).
- The returned angle is given in radians in the range -pi/2 to pi/2.
- The number (x) must be between -1 and 1.
Example
ASIN(0.5)
returns 0.523599.
ATAN
ATAN(x)
: Returns the arctangent, or inverse tangent, of a number (x).
Returns the arctangent, or inverse tangent, of a number. The arctangent is the angle whose tangent is (x). The returned angle is given in radians in the range -pi/2 to pi/2.
Example
ATAN(0.8)
returns 0.674741.
ATAN2
ATAN2(y, x)
: Returns the arctangent, or inverse tangent, of y and x (Arc - Tangent of (y/x)).
Example
ATAN2(4, -3)
returns 2.2143.
Average
Average(n1, ...)
: Returns the average of a list of numbers. NULL values are treated as 0 and taken into consideration in the calculation of the average value.
Example
Average(20,30,55)
returns 35 since [(20+30+55)/3]= 35.
CEIL
CEIL(x)
: Returns the smallest integer greater than or equal to a number (x). Works like the RoundUp function in Excel.
Example
CEIL(1.1)
returns 2.
CEIL (6.54)
returns 7.
CEIL(-30.42)
returns -30.
COS
COS(x)
: Returns the cosine of a given angle (x). x must be in radians.
Example
COS(1)
returns 0.54030230586814.
COSH
COSH(x)
: Returns the hyperbolic cosine of a number (x).
Example
COSH(1)
returns 0.54030230586814.
DISTANCE
DISTANCE(from_Lat,from_Lon, to_Lat, to_Lon)
: Returns the distance from (lat1,Lon1) to (lat2,lon2).
Example
DISTANCE(42, -90, 43, -80)
returns a value of 513.473706 miles.
EXP
EXP(x)
: Returns the constant e raised to the power of an exponent (x) (e^x).
FLOOR
FLOOR(x)
: Returns the largest integer less than or equal to a number (x).
Example
FLOOR(1.1)
returns 1.
FLOOR(6.54)
returns 6.
FLOOR(-30.42)
returns -31.
LOG
LOG(x)
: Returns the natural logarithm of a number (x). x should be a positive number.
Example
LOG(1)
returns 0.
LOG(14)
returns 2.639057.
LOG10
LOG10(x)
: Returns the base-10 logarithm of a number (x). x should be a positive number.
Example
LOG10(1)
returns 0.
LOG10(14)
returns 1.146128.
Median
Median(...)
: Calculates the median of 1 or more (possibly unsorted) values.
Example
Median (5, 4, 3, 7, 6)
returns 5.
Mod
Mod(n,d)
: Modulo of a number (n) divided by a number (d) (integer operation).
The Modulo operation finds the remainder of 1 integer (n) divided by a divisor integer (d).
- If (n) is positive, the result is positive.
- If (n) is negative, the result is negative.
If you use decimal values, the decimal is truncated. This can result in a "Divided by 0" error if the divisor is a decimal less than 1.
Example
MOD(6,4)
returns 2.
MOD(6,-4)
returns 2.
MOD(-6,4)
returns -2.
MOD(-6,-4)
returns -2.
MOD(6,.4)
returns [Null].
PI
PI()
: Returns the value of the constant PI to 15 digits of accuracy.
Example
PI()
returns 3.141593.
POW
POW(x, e)
: Returns a number (x) raised to the (e) power.
Example
POW(2, 3)
is equivalent to 2 3 and returns 8.
RAND
RAND()
: Returns a random number greater than or equal to 0 and less than 1.
Example
RAND()
returns a random number like 0.256.
RandInt
RandInt(n)
: Returns a random integer between 0 and the specified parameter (n).
Example
RandInt(10)
returns 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 or 10.
RandInt(5000)
returns a random whole number between 0 and 5000, like 741.
Round
Round(x, mult)
: Returns a number (x) rounded to the nearest multiple of (mult).
Example
Round(55.34, 2)
returns a value of 56.
Round(39.88, 10)
returns a value of 40.
Round(41.1, 10)
returns a value of 40.
Round(1.25, 0.1)
returns a value of 1.3.
Round(1.227, 0.01)
returns a value of 1.23.
SIN
SIN(x)
: Returns the sine of a given angle (x). x must be in radians.
Example
SIN(90)
returns 0.893996663600558.
SINH
SINH(x)
: Returns the hyperbolic sine of a number (x).
Example
SINH(4)
returns 27.2899171971278.
SmartRound
SmartRound(x)
: Returns a number (x) rounded to the nearest multiple of a value determined dynamically based on the size of (x).
SQRT
SQRT(x)
: Returns the square root of a number (x).
Example
SQRT(100)
returns a value of 10.
TAN
TAN(x)
: Returns the tangent of a given angle (x). x must be in radians.
Example
TAN(1)
returns 1.5574077246549.
TANH
TANH(x)
: Returns the hyperbolic tangent of a number (x).
Example
TANH(90)
returns 1.