The category table of ECMA-376 5th edition Part 1 (December 2016) section 18.17.7 lists 39 engineering functions: four Bessel functions, twelve base conversions (BIN2DEC to OCT2HEX), COMPLEX and the seventeen IM functions that work on complex numbers, CONVERT, ERF, ERFC, DELTA and GESTEP (4 + 12 + 1 + 17 + 5 = 39). This page gives their arguments, return values and examples as the standard states them, then [MS-OI29500] v20260818’s notes on what Office does differently, then what LibreOffice returns. Section numbers are the standard’s own. Excel’s later additions (BITAND, BITOR, BITLSHIFT, BITRSHIFT, BITXOR, ERF.PRECISE, ERFC.PRECISE, IMCOSH, IMCOT, IMCSC, IMSEC, IMSINH, IMTAN and others) are not in Part 1 and are not described.
How the examples were checked
The standard’s examples and edge cases were written as 150 formulas in a flat ODS workbook, made by
samples/xlsx/oracle/make-fods.mjs from formulas.txt and converted to CSV by
LibreOffice (soffice --headless --convert-to csv; files in samples/xlsx/oracle/engfn/). Row N of
the CSV is formula N. LibreOffice is an implementation, not the standard: where it differs the difference is
reported, not corrected. Its error spelling here is Err:502 (invalid argument), which stands for
the standard’s #NUM! or #VALUE! or #N/A in each case below. The numbers below are LibreOffice’s,
shown with up to 15 digits; the standard’s own digits are given where they differ.
Bessel functions (.23 to .26)
BESSELI ( x , n ), BESSELJ, BESSELK, BESSELY: the
modified Bessel functions In and Kn and the Bessel functions Jn and Yn of the number x and the
order n. n is truncated to an integer; if n < 0 the result is #NUM!.
| Standard’s example | Standard says | LibreOffice |
|---|---|---|
BESSELI(-5.6,0) | 46.73755194 | 46.7375512926373 (differs from the 7th decimal) |
BESSELI(2.345,5) | 0.023137792 | 0.0231377922561073 |
BESSELJ(-5.6,0) | 0.026970887 | 0.0269708846851143 (differs from the 9th decimal) |
BESSELJ(2.345,5) | 0.014627862 | 0.0146278617478992 |
BESSELK(2.345,5) | 3.904137225 | 3.90413722519097 |
BESSELY(2.345,5) | -4.98977884 | -4.98977887509725 (differs from the 8th decimal) |
BESSELI(2,-1) | #NUM! | Err:502 |
BESSELJ(2.345,5.9) | n truncated to 5 | 0.0146278617478992, the same as order 5 |
The last digits of the standard’s examples are shorter than a double, so any implementation agrees to about seven digits. Excel notes (MS-OI29500 2.1.889 to 2.1.892): the standard does not say how the arguments map to the formula variables; Office maps x to argument x and n to argument n. For BESSELK Office uses Kn(x) = (π/2) in+1 [Jn(ix) + iYn(ix)] where the standard’s formula prints “p” for π.
Base conversion (BIN2DEC to OCT2HEX)
Twelve functions convert among binary, octal, decimal and hexadecimal. A number of ten digits is a
two’s-complement value whose left-most bit is the sign (binary and octal keep this ten-digit width:
binary 10 bits, octal 30 bits, hexadecimal 40 bits). Shorter text is padded with leading zeros. A negative
result always has ten digits and ignores places. Common errors, all #NUM!: a digit that does
not belong to the base; more than ten digits; a result that needs more digits than places;
places ≤ 0 or > 10; a number outside the range of its width.
| Function | Arguments | Range of the number | Returns |
|---|---|---|---|
BIN2DEC (.29) | number | 1000000000 (-512) to 0111111111 (511) | number |
BIN2HEX (.30) | number [, places] | same, 200 to 1FF hex | text, upper case |
BIN2OCT (.31) | number [, places] | same, 1000 to 0777 octal | text |
DEC2BIN (.84) | number [, places] | -512 to 511 | text |
DEC2HEX (.85) | number [, places] | -549,755,813,888 to 549,755,813,887 | text, upper case |
DEC2OCT (.86) | number [, places] | -536,870,912 to 536,870,911 | text |
HEX2BIN (.140) | number (text) [, places] | FFFFFFFE00 to 1FF (-512 to 511) | text |
HEX2DEC (.141) | number (text) | 8000000000 to 7FFFFFFFFF; not case-sensitive | number |
HEX2OCT (.142) | number (text) [, places] | FFE0000000 to 1FFFFFFF | text |
OCT2BIN (.237) | number (text) [, places] | 7777777000 to 777 (-512 to 511) | text |
OCT2DEC (.238) | number (text) | 4000000000 to 3777777777 | number |
OCT2HEX (.239) | number (text) [, places] | 4000000000 to 3777777777 | text, upper case |
| Standard’s example | Standard says | LibreOffice |
|---|---|---|
BIN2DEC(111); (11111111); (1111111110); (1000000000) | 7; 255; -2; -512 | 7; 255; -2; -512 |
BIN2HEX(1); (1,4); (111111) | 1; 0001; 3F | 1; 0001; 3F |
BIN2HEX(1111000000); (1000000000,3) | FFFFFFFFC0; FFFFFFFE00 | FFFFFFFFC0; FFFFFFFE00 |
BIN2OCT(1); (1,4); (111111) | 1; 0001; 77 | 1; 0001; 77 |
BIN2OCT(1111000000); (1000000000,3) | 7777777700; 7777777000 | 7777777700; 7777777000 |
DEC2BIN(23); (-256); (18,7) | 10111; 1100000000; 0010010 | 10111; 1100000000; 0010010 |
DEC2HEX(23); (-256); (18,7) | 17; FFFFFFFF00; 0000012 | 17; FFFFFFFF00; 0000012 |
DEC2OCT(23); (-256); (18,7) | 27; 7777777400; 0000022 | 27; 7777777400; 0000022 |
HEX2BIN("fE"); ("FFFFFFFFFE"); ("2"); ("F",6) | 11111110; 1111111110; 10; 001111 | the same four |
HEX2DEC("fE"); ("FFFFFFFFFE"); ("F000000000") | 254; -2; -68719476736 | 254; -2; -68719476736 |
HEX2OCT("fE"); ("FFFFFFFFFE"); ("2"); ("F",6) | 376; 7777777776; 2; 000017 | the same four |
OCT2BIN("67"); ("7777777776"); ("7",5) | 110111; 1111111110; 00111 | the same three |
OCT2DEC("67"); ("7777777776"); ("7000000000") | 55; -2; -134217728 | 55; -2; -134217728 |
OCT2HEX("777"); ("7777777776"); ("7",5) | 1FF; FFFFFFFFFE; 00007 | the same three |
Edge cases, all as the standard says (#NUM! is LibreOffice’s Err:502): BIN2DEC(12) and an
eleven-digit binary number give an error; BIN2HEX(1,0) and BIN2HEX(111111,1) give an
error; DEC2BIN(512) errors and DEC2BIN(-512) is 1000000000;
DEC2BIN(23,2) and DEC2BIN(23,0) error; DEC2HEX(549755813887) is
7FFFFFFFFF and DEC2HEX(549755813888) errors; DEC2OCT(536870912) errors;
HEX2BIN("200") and HEX2BIN("G") error; OCT2BIN("8") errors.
HEX2DEC("") is 0 in LibreOffice (the standard does not say).
Excel notes: BIN2DEC (2.1.894) – the standard says the result is a decimal string;
Office returns a number. DEC2BIN, DEC2HEX and DEC2OCT (2.1.928 to 2.1.930) – Office truncates
number to an integer. OCT2BIN (2.1.1006) – Office does not ignore
places when the number is negative. OCT2DEC (2.1.1007) – Office treats
number as text.
COMPLEX (.45) and the IM functions (.149 to .165)
COMPLEX ( real-number , imaginary-number [ , suffix ] ) makes the text x+yi or
x+yj; suffix is "i" or "j" (default "i"), any
other value gives #VALUE!. The seventeen IM functions take complex numbers as text in the same two forms and
return a number (IMABS, IMAGINARY, IMARGUMENT, IMREAL) or text (the rest); a text that is not a complex number
gives #NUM!.
| Standard’s example | Standard says | LibreOffice |
|---|---|---|
COMPLEX(-3.5,19.6); COMPLEX(3.5,-19.6,"j") | -3.5+19.6i; 3.5-19.6j | the same |
COMPLEX(3.5,0); COMPLEX(0,2.4); COMPLEX(0,0) | 3.5; 2.4i; 0 | 3.5; 2.4i; 0 (the standard’s own description of zero real is reversed, see below) |
COMPLEX(1,1,"k"); COMPLEX(1,1,"I") | #VALUE! | Err:502 for both (the suffix is case-sensitive) |
IMABS("3+4i"); ("-2.5-34.6j") | 5; 34.69020035 | 5; 34.6902003453425 |
IMAGINARY("3+4i"); ("-2.5-34.6j") | 4; 34.6 (the standard prints a positive 34.6 for -34.6j, a slip) | 4; -34.6. IMAGINARY("5") 0; IMAGINARY("i") 1 |
IMARGUMENT("13+4i"); ("-2.5-5j") | 0.298498932; -2.034443936 | 0.298498931586179; -2.0344439357957 |
IMCONJUGATE("2.3+4.5i"); ("-1-4j") | 2.3-4.5i; -1+4j | the same |
IMCOS("2.3+4.5i"); ("-1-4j") | -29.9918288739746-33.5589799796873i; 14.7547011704838-22.963673499193j | the same, digit for digit |
IMDIV("13+4i","5+3i"); ("-3-3.5i","5+3i") | 2.26470588235294-0.558823529411765i; -0.75-0.25i | the same. IMDIV("1+i","0") Err:502 |
IMEXP("2.3+4.5i"); ("-1-4j") | -2.10251576423113-9.75006374866818i; -0.240462049968584+0.278412079051034j | the same |
IMLN("3+4i"); ("-2.5-34.6j") | 1.6094379124341+0.927295218001612i; 3.54645723627033-1.64292531532225j | the first the same; the second ends ...532226j (last digit) |
IMLN("0") | #NUM! | Err:502 |
IMLOG10("3+4i"); ("-2.5-34.6j") | 10.698970004336019+0.402719196273373i; 11.54020680801806-0.713513398623614j | 0.698970004336019+0.402719196273373i; 1.54020680801806-0.713513398623616j. The standard’s real parts have a stray leading 1 (log10 of 5 is 0.69897); LibreOffice is right |
IMLOG2("3+4i"); ("-2.5-34.6j") | 2.32192809506607+1.33780421255394i; 5.11645626788577-2.37024020514877j | 2.32192809488736+1.33780421245098i; 5.11645626749198-2.37024020496635j (the standard’s values differ from the 10th digit; log2(5) is 2.321928094887362, so LibreOffice is the more exact) |
IMPOWER("2.3+4.5i",2.5); ("-1-4j",-3.56) | -52.9752689709953+22.138528463954i; 6.34818926783845E-003+1.16156377299512E-003j | -52.9752689709953+22.138528463954i; 0.00634818926783845+0.00116156377299512j (the standard writes the exponent form of the old Excel; the number is the same) |
IMPRODUCT("13+4i"); ("-3-3.5i","5+3i"); ("1.3-2j","-3.4+3j","2.3-6j") | 13+4i; -4.5-26.5i; 67.834+15.13j | the same three |
IMREAL("3+4i"); ("-2.5-34.6j") | 3; -2.5 | 3; -2.5. IMREAL("abc") Err:502 |
IMSIN("2.3+4.5i"); ("-1-4j") | 33.567264016308-29.9844272159606i; -22.9790855778861-14.7448051885587j | the same |
IMSQRT("2.3+4.5i"); ("-1-4j") | 1.91751290835255+1.17339496918073i; 1.24962106768765-1.60048518044024j | the same |
IMSUB("13+4i","5+3i"); ("-3-3.5i","5+3i") | 8+i; -8-6.5i | the same |
IMSUM("3+4i"); ("3+4i","5-3i") | 3+4i; 8+i | the same. IMSUM("3+4i","5-3j") (mixed suffixes) is 8+i |
IMABS("3+4k") | #NUM! | Err:502 |
A coefficient of 1 is written without the digit (8+i), and the real part is omitted when it is
zero. Excel notes: COMPLEX (2.1.899) – the standard says that when the real part is 0
and the imaginary part is not, the string contains “just the real number”; Office gives just the
imaginary number and suffix, which is also what the standard’s own example COMPLEX(0,2.4) =
2.4i shows. IMARGUMENT, IMPOWER and IMSQRT (2.1.965, 2.1.970, 2.1.972) – Office calculates the angle as
ATAN2(x,y); IMLN (2.1.967) likewise. IMARGUMENT also accepts both i and j. IMDIV (2.1.966), IMLN (2.1.967),
IMLOG10 (2.1.968), IMLOG2 (2.1.969) – #NUM! for a zero divisor or argument. IMPOWER (2.1.970) –
#NUM! if the number is zero and the exponent is not positive; Office treats y only as the exponent.
IMSIN (2.1.971) – the standard’s formula has a minus before the cos(x)sinh(y)i term; Office uses a
plus (which is the correct mathematics, and what the standard’s examples and LibreOffice show).
CONVERT (.48)
CONVERT ( number , from-unit , to-unit ): converts a number between units of one measurement
category. Unit names and prefixes are case-sensitive. The standard lists these units:
| Category | Units (standard) |
|---|---|
| Weight and mass | g, lbm, ozm, sg, u |
| Distance | ang, ft, in, m, mi, Nmi, Pica, yd |
| Time | day, hr, mn, sec, yr |
| Pressure | at or atm, mmHg, P or p |
| Force | dy or dyn, lbf, N |
| Energy | BTU or btu, c, cal, e, ev or eV, flb, HPh or hh, J, Wh or wh |
| Power | H or hp, W or w |
| Magnetism | ga, T |
| Temperature | C or cel, F or fah, K or kel |
| Liquid measure | l or lt, ml, tsp, tbs, oz, cup, pt or us_pt, qt, gal, US_cup, US_gal, US_oz, US_pt, US_qt, US_tbs, US_tsp, and the imperial, Australian, Canadian, Japanese, Czech and metric names (AU_tbs, CZ_mass, CZ_mug, GB_tbs and so on) |
Metric units take the prefixes E (1E+18), P, T, G, M (1E+06), k, h (1E+02), e (1E+01, deka), d, c, m, u, n, p, f and a (1E-18). #N/A is returned for an unknown unit, for units of different categories, and for a prefix on a unit that does not take one.
| Standard’s example | Standard says | LibreOffice |
|---|---|---|
CONVERT(10,"ozm","g") | 283.4951521 | 283.495152079732 |
CONVERT(1,"yd","mm") | 914.4000003 | 914.4 (the standard’s figure comes from a slightly different yard) |
CONVERT(1,"yd","cm"); "m"; "km" | 91.44000003; 0.9144; 0.0009144 | 91.44; 0.9144; 0.0009144 |
CONVERT(1,"mi","Nmi") | 0.868976242 | 0.868976241900648 |
CONVERT(1,"day","sec") | 86400 | 86400 |
CONVERT(0,"K","C") | -273.15 | -273.15 |
CONVERT(1,"m","kg") (different categories) | #N/A | Err:502 |
CONVERT(1,"M","m"); CONVERT(1,"km","M") | #N/A (unit M does not exist; the prefix M needs a unit after it) | Err:502 for both |
CONVERT(1,"gal","l"); (1,"us_gal","l") | gal is the U.S. gallon, 3.785 l; us_gal is not in the table | 3.785411784; Err:502 |
CONVERT(1,"uk_pt","ml") | uk_pt is the imperial pint, 568.26 ml | 568.26125 |
CONVERT(100,"C","F") | (not in the standard) | 212 |
Excel notes (MS-OI29500 2.1.901): (a) the unit for Pascal is Pa or
p, not P (which is the peta prefix); (b) Horsepower is h or HP, not H or
hp; (c) cup, oz, tbs and tsp are the traditional U.S.
units; (d) U.S. pint is pt or us_pt (the standard’s text “ptorus_pt”
is two names run together); (e) Office does not support these liquid conversions: AU_tbs, CZ_mass, CZ_mug,
GB_tbs, CA_tbs, JP_tbs, imperial_gal, AU_gal, CA_gal, GB_gal, imperial_oz, AU_oz, CA_oz, GB_oz, imperial_pt,
AU_pt, CA_pt, GB_pt, imperial_qt, AU_qt, CA_qt, GB_qt, JP_cup, metric_cup, AU_cup, CA_cup, NZ_cup,
metric_tsp, AU_tsp, CA_tsp, JP_tsp and GB_tsp. uk_pt is not in that list.
ERF (.108), ERFC (.109), DELTA (.88) and GESTEP (.136)
ERF ( lower-bound [ , upper-bound ] ): the error function (2/√π) ∫ e-t²
dt integrated from 0 to the bound, or between the two bounds. With one argument the bound is that argument and
the lower limit is 0. A negative bound gives #NUM! in the standard. ERFC ( lower-bound ) is
1 − ERF, integrated from the bound to infinity; a negative bound gives #NUM!.
DELTA ( number-1 [ , number-2 ] ) is 1 if the numbers are equal, otherwise 0 (number-2 defaults
to 0). GESTEP ( number [ , step ] ) is 1 if number ≥ step, otherwise 0 (step defaults to 0).
| Standard’s example | Standard says | LibreOffice |
|---|---|---|
ERF(1.234,4.5432) | 0.08096060 | 0.0809605829105099 |
ERF(0,1.345); ERF(1.345) | 0.94284416 | 0.942844171087856 for both |
ERF(-1); ERF(-1,1) | #NUM! | -0.842700792949715; 1.68540158589943 (LibreOffice accepts negative bounds, like current Excel) |
ERFC(1.234); ERFC(0) | 0.08096060; 1.00000000 | 0.0809605830423316; 1 |
ERFC(-1) | #NUM! | 1.84270079294971 |
DELTA(10.5,10.5); (10.5,10.6); (10.5); (0) | 1; 0; 0; 1 | 1; 0; 0; 1 |
GESTEP(5.6,-4.3); (5.6,5.6); (-5.6) | 1; 1; 0 | 1; 1; 0 |
The standard’s ERFC return-value sentence reads “if lower-bound is negative lower-bound or
upper-bound is negative”, two sentences run together; ERFC has no upper bound. Excel notes
(MS-OI29500 2.1.947, 2.1.948): the standard does not say how the arguments map to the formula
variables: Office maps z and a to lower-bound, b to upper-bound (ERF), and x to
lower-bound (ERFC). The notes say nothing about negative bounds.
What the viewer does
The viewer shows the value a cell stores and never recalculates a worksheet, and its conditional-format
calculator (explorer/formats/xlsx/cf.js) implements none of the engineering functions. A
conditional-format rule that uses one is reported as not calculated and is not applied.
See also
- Formulas: constants, error values, references
- Functions: math: DEGREES, RADIANS and the other math functions
- Functions: text
- Functions: information
Not described on this page
- Excel’s own results: only [MS-OI29500] was read; Excel was not run, so the last column is LibreOffice, not Excel.
- The Excel-only engineering functions listed in the first paragraph, which are not in Part 1.
- CONVERT: only 17 conversions were run; the standard’s full unit table (about 100 units and the prefix rules) was not tested unit by unit, and the liquid-measure family names were not run through LibreOffice.
- Digits beyond 15: the oracle CSV shows LibreOffice’s display of each value, so ties in the last digit of the Bessel, IMLN and IMLOG2 examples are not resolved against an exact reference.
- The other categories of 18.17.7: statistical, financial, database, cube, web and the math functions outside the math page.
Sources
- ECMA-376 5th edition Part 1, research/ooxml/ecma376/p1/part1.txt: category table (line 76984), .23 to .26 Bessel (78012), .29 to .31 BIN2 (78178), .45 COMPLEX (78891), .48 CONVERT (78957), .84 to .86 DEC2 (80952), .88 DELTA (81060), .108 ERF (81735), .109 ERFC (81777), .136 GESTEP (82487), .140 to .142 HEX2 (82667), .149 to .165 IM (83013), .237 to .239 OCT2 (85680)
- [MS-OI29500] v20260818, research/ooxml/ms/MS-OI29500.txt, notes 2.1.889 to 2.1.894 (line 18064), 2.1.899 and 2.1.901 (18334), 2.1.928 to 2.1.930 (18752), 2.1.947 and 2.1.948 (18934), 2.1.965 to 2.1.972 (19044), 2.1.1006 and 2.1.1007 (19478)
- LibreOffice, soffice headless, flat ODS to CSV: samples/xlsx/oracle/engfn/