🔢 Number Functions
Arithmetic and mathematical calculations.
| Function | Description | Syntax | Parameters | Example |
|---|---|---|---|---|
ADD |
Adds two numbers together. Same as the + operator. |
ADD(Number, Number) |
Number 1 — the first number.Number 2 — the second number. | ADD(1, 2) = 3 |
MULTIPLY |
Multiplies two numbers together. Same as the * operator. |
MULTIPLY(Number, Number) |
Number 1 — the first number.Number 2 — the second number. | MULTIPLY(2, 5) = 10 |
DIVIDE |
Divides the first number by the second. Same as the / operator. |
DIVIDE(Dividend, Divisor) |
Dividend — the number to divide.Divisor — the number to divide by. | DIVIDE(10, 2) = 5 |
ROUND |
Rounds a number to a given number of decimal places. | ROUND(Number, Digits) |
Number — the value to round.Digits — how many decimal places to round to. | ROUND(1.12345, 2) = 1.12 |
TRUNC |
Truncates a number to its integer part, discarding any decimals (no rounding). | TRUNC(Number) |
Number — the value to truncate. | TRUNC(1.49) = 1 |
FLOOR |
Rounds a number down to the nearest integer. | FLOOR(Number) |
Number — the value to round down. | FLOOR(1.51) = 1FLOOR(-1.49) = -2 |
CEIL |
Rounds a number up to the nearest integer. | CEIL(Number) |
Number — the value to round up. | CEIL(1.49) = 2CEIL(-1.51) = -1 |
ABS |
Returns the absolute (non-negative) value of a number. | ABS(Number) |
Number — the value to convert. | ABS(-1.51) = 1.51 |
SIGN |
Returns 1 for a positive number, -1 for a negative number, 0 for zero. |
SIGN(Number) |
Number — the value to evaluate. | SIGN(-9.0) = -1 |
GREATEST |
Compares two numbers and returns the larger one. | GREATEST(Number, Number) |
Number 1, Number 2 — the values to compare. | GREATEST(1, 2) = 2 |
LEAST |
Compares two numbers and returns the smaller one. | LEAST(Number, Number) |
Number 1, Number 2 — the values to compare. | LEAST(1, 2) = 1 |
MOD |
Returns the remainder after dividing the first number by the second. | MOD(Number, Number) |
Number 1 — the dividend.Number 2 — the divisor. | MOD(5, 2) = 1MOD(-3, 2) = -1 |
POWER |
Raises a number to the power of an exponent. | POWER(Number, Exponent) |
Number — the base.Exponent — the power to raise it to. | POWER(3, 2) = 9POWER(25, 0.5) = 5.0 |
SQRT |
Returns the square root of a number. Returns NaN for negative or invalid input. |
SQRT(Number) |
Number — the value to find the square root of. | SQRT(9) = 3SQRT(-4) = NaN |
EXP |
Returns Euler's number (e ≈ 2.718) raised to the power of the given number. | EXP(Number) |
Number — the exponent to raise e to. | EXP(1) = 2.718EXP(0) = 1 |
LOG |
Returns the exponent to which a base must be raised to produce a given number. | LOG(Base, Number) |
Base — the base of the logarithm.Number — the value to find the exponent for. | LOG(3, 9) = 2 |
EVEN |
Returns TRUE if a number is even, FALSE otherwise (including for invalid input). |
EVEN(Number) |
Number — the value to check. | EVEN(2) = trueEVEN(5) = false |
TONUMBER |
Converts a text value into a number, if possible. | TONUMBER(Text) |
Text — the text to convert. | TONUMBER('10') = 10 |
IS_NAN |
Returns TRUE if a value is NaN (Not a Number), FALSE otherwise. |
IS_NAN(Number) |
Number — the value to check. | IS_NAN(1 / 0) = true |
WHEN_NAN |
Returns a fallback value if the first argument evaluates to NaN; otherwise returns the first argument. |
WHEN_NAN(Number, Fallback) |
Number — the value to check.Fallback — the value to use if it's NaN. |
WHEN_NAN(1 / 0, 4) = 4WHEN_NAN(1, 4) = 1 |