Math

Scripting Formulas Math

All formulas in the Math section can be prepended with MATH. for clarity. For example, ABS becomes MATH.ABS. Some sections, like FINANCE, require prepending the section name.

  • ABS — Returns the absolute value of value.
  • ACOS — Computes the arc cosine of value.
  • ACOSH — Computes the inverse hyperbolic cosine of value.
  • ASIN — Computes the arc sine of value.
  • ASINH — Computes the inverse hyperbolic sine of value.
  • ATAN — Computes the arc tangent of value.
  • ATAN2 — Computes the arc tangent given value1 and value2.
  • ATANH — Computes the inverse hyperbolic tangent of value.
  • AVERAGE — Returns the average of the values given.
  • BIN2DEC — Converts a binary-formatted value to decimal format.
  • BIN2HEX — Converts a binary-formatted value to hexadecimal format.
  • BIN2OCT — Converts a binary-formatted value to octal format.
  • CBRT — Returns the cube root of value.
  • COS — Computes the cosine of value (expressed in radians).
  • COSH — Computes the hyperbolic cosine of value (expressed in radians).
  • COUNT — Returns the number of elements in the array values.
  • DEC2BIN — Converts a decimal-formatted value to binary format.
  • DEC2HEX — Converts a decimal-formatted value to hexadecimal format.
  • DEC2OCT — Converts a decimal-formatted value to octal format.
  • ERF — Calculates the error function of value.
  • ERFC — Calculates the complementary error function of value.
  • EXP — Returns e to the power of value.
  • FREXP — Returns a two-element array containing the normalized fraction and exponent of value.
  • GAMMA — Calculates the gamma function of value.
  • GCD — Calculates the Greatest Common Denominator of value1 and value2.
  • HEX2BIN — Converts a hexadecimal-formatted value to binary format.
  • HEX2DEC — Converts a hexadecimal-formatted value to decimal format.
  • HEX2OCT — Converts a hexadecimal-formatted value to octal format.
  • HYPOT — Returns sqrt(x^2 + x^2), the hypotenuse of a right-angled triangle with sides x and y.
  • IS_EVEN — Checks whether the number value is even.
  • IS_ODD — Checks whether the number value is odd.
  • LCM — Calculates the Least Common Multiple of value1 and value2.
  • LDEXP — Returns the value of fraction × (2^exponent).
  • LGAMMA — Returns an array of two elements: the logarithmic gamma of value, and the sign of gamma of value. The second element will be returned as -1 or 1.
  • LOG — Returns the logarithm of value. If the optional base is given, it will be the base of the logarithm. If not, it will be e (for the natural logarithm).
  • LOG10 — Returns the base 10 logarithm of value.
  • LOG2 — Returns the base 2 logarithm of value.
  • MAX — Returns the largest number in values.
  • MIN — Returns the smallest number in values.
  • MOD — Calculates the result of value % divisor.
  • N — Converts a text value to a number. Text will generally be automatically converted when used in math formulas, but if you run into issues or you'd like to specifically exclude non-numeric characters, you can use this function to force conversion.
  • NUMBER — Converts a numeric value to a different base.
  • OCT2BIN — Converts an octal-formatted value to binary format.
  • OCT2DEC — Converts an octal-formatted value to decimal format.
  • OCT2HEX — Converts an octal-formatted value to hexadecimal format.
  • RAND — Generates a random number between min and max.
  • ROUND — Rounds the number value.
  • ROUNDDOWN — Rounds the number value down.
  • ROUNDUP — Rounds the number value up.
  • SIGN — Returns the sign of value.
  • SIN — Computes the sine of value (expressed in radians).
  • SINH — Computes the hyperbolic sine of value.
  • SQRT — Returns the non-negative square root of value.
  • SUM — Calculates the total of the passed numeric values.
  • TAN — Computes the tangent of value (expressed in radians).
  • TANH — Computes the hyperbolic tangent of value (expressed in radians).