COMPLEX Function (OpenOffice Calc)
Build complex-number text with Apache OpenOffice COMPLEX, including i/j suffix rules, zero components and reproducible returned strings.
Verification status: Eight reference formulas and 4 diagnostic cases were recalculated in Apache OpenOffice 4.1.16 on Linux x86-64, Build 9816, using XLSX import and GUI hard recalculation. Saved formula identities and typed results were checked. How formula examples are checked
Quick answer: =COMPLEX(3;4) returned 3+4i in the tested Apache OpenOffice 4.1.16 build.
Availability and version history
- Introduced: First release not established; documented by OpenOffice.org 3.3.
- Supported in: Apache OpenOffice 4.1.16; this identifies a verified release, not a final supported version.
- Scope: Desktop Calc with its Analysis add-in, English function names and semicolon-separated formulas.
- Checked: October 14, 2026. Eight reference formulas and the listed diagnostics were recalculated after XLSX import in 4.1.16 on Linux x86-64, Build 9816. Source and independent reference calculations were also checked.
What COMPLEX returns
COMPLEX constructs a text representation of a complex number from its real and imaginary numeric components. The result can feed the IM family of functions. It is not ordinary numeric addition, and a returned string such as “5” still comes from a text-returning add-in. Release entry.
Syntax and arguments
=COMPLEX(Real; Imaginary [; Suffix])
Real and Imaginary are required. The optional suffix defaults to lowercase i; lowercase j is also accepted. The inspected implementation treats an empty suffix as i and rejects other suffix strings. The suffix affects the imaginary-unit symbol, not the mathematics. Use exact lowercase spelling.
Reproducible examples
The native column records the saved 4.1.16 results. For text-returning functions the strings are compared exactly. Ordinary numeric values are rounded to twelve decimal places, with scientific notation for tiny values. Stored values and display text were inspected separately; a twelve-decimal cell display can hide a tiny nonzero number.
| Formula | Native 4.1.16 result | Independent reference |
|---|---|---|
=COMPLEX(3;4) |
3+4i |
3+4i |
=COMPLEX(3;-4) |
3-4i |
3-4i |
=COMPLEX(-3;4) |
-3+4i |
-3+4i |
=COMPLEX(-3;-4) |
-3-4i |
-3-4i |
=COMPLEX(0;1) |
i |
i |
=COMPLEX(0;-1) |
-i |
-i |
=COMPLEX(5;0) |
5 |
5 |
=COMPLEX(0;0) |
0 |
0 |
Practical worksheet
=COMPLEX(3;4) returns 3+4i; changing the imaginary component to −4 returns 3-4i. With suffix “j”, =COMPLEX(3;4;"j") constructs 3+4j. This can suit a convention where j denotes the imaginary unit.
Put real and imaginary components in A2:B2 and use =COMPLEX(A2;B2) in C2. Keep the components separately as numeric data as well. Concatenating unvalidated imported text can create an invalid complex string even when it looks similar on screen.
Advanced interpretation and checks
The formatter omits a zero component where appropriate and suppresses the coefficient 1 before the imaginary unit. Thus (0,1) becomes i, (0,−1) becomes -i, (5,0) becomes 5, and (0,0) becomes 0. These are representational conventions, not different mathematical values.
Independently, a constructed 3+4i has magnitude 5 and conjugate 3−4i. Functions such as IMABS and IMCONJUGATE operate on that value; ordinary SUM does not become a complex arithmetic function merely because a cell contains complex-number text.
The suffix is not a unit conversion or a phase angle. It should be chosen consistently with the downstream formulas and the target program’s parser. A visually similar uppercase I or J is not automatically accepted.
Boundaries and troubleshooting
The source rejects unsupported suffixes, and the diagnostic table records actual uppercase and arbitrary-letter cases. This differs from an implementation that accepts a third argument but ignores it.
Finite numeric components are required for a useful result. The formatter checks for finite values before returning a string. The moderate integer examples do not certify exact decimal serialization for every magnitude or locale.
These additional formulas were recalculated through the same import path. Error displays are retained as errors, even when an ODS numeric attribute stores zero.
| Formula | Observed result or error |
|---|---|
=COMPLEX(3;4;"j") |
3+4j |
=COMPLEX(3;4;"") |
3+4i |
=COMPLEX(3;4;"J") |
Err:502 |
=COMPLEX(3;4;"x") |
Err:502 |
Other spreadsheet implementations
The COMPLEX guide for Calligra Sheets documents that product’s own syntax and tested behavior. A shared function name does not guarantee the same argument conversion, text parsing, branch or precision rules.
Official evidence and checking scope
- Function-specific release entry
- Numeric algorithm or complex parser/formatter
- Strict complex-string parser
The saved ODS retained every tested formula identity. A deliberately stale SUM cache changed from 999999 to 3, and an uncached SUM returned 7 after hard recalculation. Native evidence covers the eight reference formulas and listed diagnostics only. Other explanatory compositions are independent mathematical checks; other releases, locales and extreme-value behavior were not established by this run.