This page lists the math and trigonometry functions of ECMA-376 5th edition Part 1 (December 2016) section 18.17.7, one row each, with the standard’s description paraphrased and, where [MS-OI29500] v20260818 has a note on the function, what Office does instead. The note ids are 2.1.876 and following. A function with no note there is stated as the standard states it. The Formulas page has the grammar these functions are called with. Arguments are written as the standard writes them; a function stored in a cell is its upper-case name followed by the arguments in parentheses, separated by commas.
How the rows were checked
The cases in the last column were evaluated by LibreOffice (soffice converting a flat ODS
workbook of 109 formulas to CSV; the workbook and its output are in the project as
samples/xlsx/oracle/mathfn/math-functions.fods and .csv). LibreOffice is an implementation, not the
standard, so a difference from a statement of the standard or of Excel is reported as a difference, never
as a correction. The viewer reads a formula and shows the value the file cached; it never calculates one,
except for the few functions a conditional-format rule uses (here ABS, INT, MOD, ROUND, SIGN, SUM, in
cf.js). Those were not compared with LibreOffice here.
LibreOffice writes the error it has no Excel name for as Err:502 (invalid argument) in CSV;
below that stands for an argument the function rejects.
Trigonometry and angles
| Function | Standard (18.17.7) | Excel note | LibreOffice |
|---|---|---|---|
ACOS(x) | .4: arc cosine of x | 2.1.876: the result is in radians (the standard gives no unit) | ACOS(-1) = 3.14159265358979; ACOS(2) = #NUM! |
ACOSH(x) | .5: inverse hyperbolic cosine of x | none | ACOSH(10) = 2.99322284612638; ACOSH(0.5) rejected |
ASIN(x) | .12: arc sine of x | 2.1.881: radians | ASIN(1) = 1.5707963267949 |
ASINH(x) | .13: inverse hyperbolic sine of x | 2.1.882: the standard’s text calls it the inverse hyperbolic cosine; Office computes the inverse hyperbolic sine | ASINH(10) = 2.99822295029797 |
ATAN(x) | .14: arc tangent of x | 2.1.883: radians | ATAN(-10) = -1.47112767430373 |
ATAN2(x, y) | .15: arc tangent of the coordinates x and y | 2.1.884: the angle of the vector from (0,0) to the point (x, y) measured from the positive x-axis, in the half-open interval (-π, π] | ATAN2(1,1) = 0.785398163397448; ATAN2(-2,2) = 2.35619449019235; ATAN2(3,-3) = -0.785398163397448; ATAN2(0,0) = 0 |
ATANH(x) | .16: inverse hyperbolic tangent of x | none | ATANH(0.999999) = 7.25432861924767 |
COS(x) | .50: cosine of x | 2.1.903: x is in radians | COS(1) = 0.54030230586814 |
COSH(x) | .51: hyperbolic cosine of x | none | COSH(-1) = 1.54308063481524 |
DEGREES(angle) | .87: converts radians to degrees | none | DEGREES(8.5) = 487.0141258612 |
RADIANS(angle) | .266: converts degrees to radians | none | RADIANS(8.5) = 0.148352986419518 |
SIN(x) | .290: sine of x | 2.1.1040: x is in radians | SIN(1) = 0.841470984807897 |
SINH(x) | .291: hyperbolic sine of x | none | SINH(100) = 1.34405857090807E+043 |
TAN(x) | .316: tangent of x | 2.1.1051: x is in radians | TAN(1) = 1.5574077246549 |
TANH(x) | .317: hyperbolic tangent of x | none | TANH(-1) = -0.761594155955765 |
PI() | .252: the constant π | none | PI() = 3.14159265358979 |
Powers, roots and logarithms
| Function | Standard (18.17.7) | Excel note | LibreOffice |
|---|---|---|---|
EXP(x) | .113: e raised to x | none | EXP(2) = 7.38905609893065 |
LN(x) | .196: natural logarithm of x | none | LN(86) = 4.45434729625351 |
LOG(x [, base]) | .197: logarithm of x to the given base | 2.1.986: the standard does not say what happens when base is 1; Office returns #DIV/0! | LOG(8,2) = 3; LOG(10,1) rejected (not #DIV/0!) |
LOG10(x) | .198: base-10 logarithm of x | none | LOG10(1E5) = 5 |
POWER(x, y) | .255: x raised to the power y | 2.1.1018: the standard says POWER(0,0) is #DIV/0!; Office returns #NUM! | POWER(-1.234,5) = -2.86138172105142; POWER(0,0) = 1 (differs from both); POWER(0,-1) = #NUM! |
SQRT(x) | .296: positive square root of x | none | SQRT(-1) rejected |
SQRTPI(x) | .297: positive square root of x times π | none | SQRTPI(2) = 2.506628274631 |
SERIESSUM(input-value, initial-power, step, coefficients) | .288: sum of a power series | 2.1.1039: the standard requires coefficients to be a reference; Office accepts an array or a reference | SERIESSUM(PI()/4,0,2, 1, -1/2!, 1/4!, -1/6!) = 0.707103214822846 |
Rounding and integers
| Function | Standard (18.17.7) | Excel note | LibreOffice |
|---|---|---|---|
ABS(x) | .1: absolute value of x | none | ABS(10.5) = 10.5; ABS(-10.5) = 10.5 |
CEILING(x, significance) | .33: x rounded up, away from zero, to a multiple of significance, whatever the sign of x | 2.1.895: the standard lets a negative x with a positive significance round toward zero; Office returns #NUM! when x and significance have different signs | CEILING(2.5,1) = 3; CEILING(-2.5,-2) = -2; CEILING(-2.5,2) rejected; CEILING(1.5,0.1) = 1.5; CEILING(0.234,0.01) = 0.24 |
EVEN(x) | .111: x rounded to the nearest even integer, away from zero | none | EVEN(1.5) = 2; EVEN(-1) = -2 |
FLOOR(x, significance) | .125: x rounded down, toward zero, to a multiple of significance | 2.1.954: the standard’s own text says a value is rounded down when adjusted toward zero; Office rounds toward zero | FLOOR(2.5,1) = 2; FLOOR(-2.5,-2) = -4; FLOOR(-2.5,2) rejected; FLOOR(0.234,0.01) = 0.23 |
INT(x) | .169: x rounded down to an integer | none | INT(-8.9) = -9 |
MOD(x, y) | .218: remainder of x divided by y, with the sign of y | none | MOD(-3,2) = 1; MOD(3,-2) = -1 |
MROUND(x, multiple) | .221: x rounded to a multiple, away from zero when the remainder is at least half the multiple | none | MROUND(10,3) = 9; MROUND(-10,-3) = -9; MROUND(1.3,0.2) = 1.4; MROUND(5,-2) = 6 |
ODD(x) | .240: x rounded to the nearest odd integer, away from zero | none | ODD(1.5) = 3; ODD(-2) = -3 |
QUOTIENT(dividend, divisor) | .265: the integer part of the division | none | QUOTIENT(-10,3) = -3; QUOTIENT(4.5,3.1) = 1 |
ROUND(x, number-digits) | .278: x rounded to the digits given | 2.1.1034: the standard says the return value is the rounded-down value; Office returns the rounded value | ROUND(2.15,1) = 2.2; ROUND(-1.475,2) = -1.48; ROUND(21.5,-1) = 20 |
ROUNDDOWN(x, number-digits) | .279: rounded toward zero | none | ROUNDDOWN(-3.14159,1) = -3.1 |
ROUNDUP(x, number-digits) | .280: rounded up, away from zero (like ROUND, but always up) | none | ROUNDUP(31415.92654,-2) = 31500 |
SIGN(x) | .289: the sign of x | none | SIGN(-5.4) = -1 |
TRUNC(x [, number-digits]) | .332: x truncated to the given number of fractional digits | 2.1.1057: the standard allows an array or reference for x; Office requires a number | TRUNC(PI(),3) = 3.141 |
Combinatorics, divisors and numerals
| Function | Standard (18.17.7) | Excel note | LibreOffice |
|---|---|---|---|
COMBIN(number, number-chosen) | .44: the number of groups of the size chosen that can be formed from the objects, order ignored | none | COMBIN(8,2) = 28; COMBIN(6,5) = 6 |
FACT(x) | .115: factorial of x | none | FACT(3.5) = 6 (the fraction is dropped); FACT(-1) rejected |
FACTDOUBLE(n) | .116: double factorial of n | none | FACTDOUBLE(3.5) = 3; FACTDOUBLE(5) = 15 |
GCD(argument-list) | .134: greatest common divisor of the numbers | none | GCD(24.5,36.3) = 12; GCD(100,50,28) = 2; GCD(5,0) = 5 |
LCM(argument-list) | .190: least common multiple of the arguments | none | LCM(24.99,36.45) = 72; LCM(24,36,15) = 360 |
MULTINOMIAL(argument-list) | .222: the ratio of the factorial of the sum to the product of the factorials | 2.1.997: the standard defines it for three values a, b, c; Office takes any number of arguments | MULTINOMIAL(2,3,4) = 1260 |
ROMAN(number, form) | .277: Arabic number converted to a Roman numeral in the form given | 2.1.1033: Office returns the empty string for 0 | ROMAN(499,0) = CDXCIX; (499,1) = LDVLIV; (499,2) = XDIX; (499,3) = VDIV; (499,4) = ID; ROMAN(2013,0) = MMXIII; ROMAN(0) = empty; ROMAN(4000) rejected |
Sums, products and matrices
| Function | Standard (18.17.7) | Excel note | LibreOffice |
|---|---|---|---|
PRODUCT(argument-list) | .261: multiplies the numeric values of the arguments | 2.1.1024: the standard says valid arguments are “counted”; Office multiplies them | PRODUCT(2,3,4,"5") = #VALUE! (a text literal is not converted) |
SUM(argument-list) | .306: adds the numeric values of the arguments | 2.1.1047: the standard says “counted”; Office adds | SUM(1,2,3,4,5,6,"7") = #VALUE!; SUM(1,"2",TRUE,4) = #VALUE! (text literals are not converted) |
SUMIF(cell-range, selection-criteria [, sum-range]) | .307: applies the criteria to one range and sums the cells in the corresponding range | none | "=10" = 20; ">5" = 27; "<>10" = 10; a wildcard criterion "*es" gave 0 in a flat ODS (wildcards are a document setting there and were off); opened from an XLSX they are on: SUMIF over apple, banana, cherry, a*b with "b*" gave 2 and with "*e" gave 1 (samples/xlsx/oracle/wildcardfn) |
SUMIFS(sum-range, cell-range-1, selection-criteria-1 [, …]) | .308: adds the cells that meet several criteria; sum-range need not match the shape of the criteria ranges | 2.1.1048: each criteria range must have the same size and shape as sum-range; cells of sum-range that are not numbers count as 0 (the standard says TRUE is 1 and FALSE is 0) | Two ranges of different shape are rejected, which agrees with Excel; two criteria on one column that exclude each other give 0 |
SUBTOTAL(function-number, argument-list) | .305: the value of the function the number designates over the arguments | none | SUBTOTAL(2,range) = 5; (9,range) = 15; (109,range) = 15; (12,range) rejected |
SUMPRODUCT(argument-list) | .309: multiplies corresponding elements of the arrays and sums the products; non-numeric elements count as 0 | 2.1.1049: arrays of different dimensions give #VALUE! (the standard says #NUM!) | 3 rows of 2 = 46; 2x2 by 2x2 = 42; mismatched dimensions = #VALUE! |
SUMSQ(argument-list) | .310: adds the squares of the arguments | 2.1.1050: the standard says “counted”; Office sums the squares | SUMSQ(2.5,-3.6) = 19.21 |
SUMX2MY2(array-1, array-2) | .311: sum of x squared minus y squared over corresponding elements | none | -55 |
SUMX2PY2(array-1, array-2) | .312: sum of x squared plus y squared | none | 521 |
SUMXMY2(array-1, array-2) | .313: sum of the squared differences | none | 79 |
MDETERM(array) | .207: determinant of a square matrix, accurate to at least 15 digits | none | MDETERM of {3,6,1;1,1,0;3,10,2} = 1 |
MINVERSE(array) | .215: inverse of a square matrix, accurate to at least 15 digits | 2.1.996: Office states the same 15-digit accuracy | first element of the inverse of {3,6;1,1} = -0.333333333333333 |
MMULT(array-1, array-2) | .217: matrix product | none | first element of {3,6,1;1,1,0} times {5,7;4,6;2,5} = 41 |
What the viewer does
The viewer reads a function call and lists it in the Formulas view; it never computes one. Its conditional-format rules compute ABS, INT, MOD, ROUND, SIGN and SUM, and the other functions of this page are reported as not calculated there.
See also
Not described on this page
- The argument tables, the error rules and the worked examples of each function in 18.17.7, beyond the cases in the last column.
- The other 298 functions of 18.17.7: the remaining math functions of the category table (for example ECMA.CEILING, ISO.CEILING and the random-number functions), and the text, date, logical, lookup, statistical, financial, engineering, database, information, cube and web functions.
- Whether the spec’s own worked examples agree with LibreOffice for every row; the last column is LibreOffice’s result for the cases tried.
Sources
- ECMA-376 5th edition Part 1, research/ooxml/ecma376/p1/part1.txt: the function-category table (lines 76961 to 77101) and the definitions 18.17.7.1 to 18.17.7.332 (from line 77102)
- [MS-OI29500] v20260818, research/ooxml/ms/MS-OI29500.txt, notes 2.1.876 to 2.1.1057 for these functions
- LibreOffice, soffice headless, flat ODS to CSV: samples/xlsx/oracle/mathfn/