COMPLEX Function (LibreOffice Calc)
The COMPLEX function converts real and imaginary numeric components into a complex number formatted as text. It is used in engineering, signal processing, AC circuit analysis, and any workflow involving complex arithmetic.
Compatibility
▾| Excel | ✔ |
| Gnumeric | ✔ |
| Google_sheets | ✔ |
| Libreoffice | ✔ |
| Numbers | ✖ |
| Onlyoffice | ✔ |
| Openoffice | ✔ |
| Wps | ✔ |
| Zoho | ✔ |
What the COMPLEX Function Does ▾
- Combines real and imaginary parts into a complex number
- Supports
"i"or"j"notation - Returns a text string, not a numeric type
- Works seamlessly with other IM* complex functions
Syntax ▾
COMPLEX(real; imaginary; [suffix])
Arguments
-
real:
The real component of the complex number. -
imaginary:
The imaginary component. -
suffix (optional):
"i"(default) or"j"— engineering notation.
Basic Examples ▾
Default imaginary unit (i)
=COMPLEX(3; 4)
→ "3+4i"
Using engineering notation (j)
=COMPLEX(5; -2; "j")
→ "5-2j"
Zero imaginary part
=COMPLEX(7; 0)
→ "7+0i"
Zero real part
=COMPLEX(0; 9)
→ "0+9i"
Advanced Examples ▾
Build a complex impedance
=COMPLEX(10; 5)
→ "10+5i"
Combine with IMSUM
=IMSUM(COMPLEX(3;4); COMPLEX(1;-2))
→ "4+2i"
Use with IMABS to compute magnitude
=IMABS(COMPLEX(A1; B1))
Use with IMSQRT for square roots of negative numbers
=IMSQRT(COMPLEX(-4; 0))
Generate a phasor from magnitude and angle
=COMPLEX(R*COSH(θ); R*SINH(θ))
Build a dynamic complex expression
=COMPLEX(A1; A2 * PI())
Edge Cases and Behavior Details ▾
COMPLEX returns a text string, not a numeric complex type
All IM* functions accept this string format.
Behavior details
- Imaginary part sign is handled automatically
"i"or"j"must be lowercase- Non-numeric inputs → Err:502
- Suffix must be
"i"or"j"only - COMPLEX does not validate magnitude or angle
COMPLEX of an error → error propagates
Common Errors and Fixes ▾
Err:502 — Invalid argument
Cause:
- Non-numeric real or imaginary part
- Invalid suffix (anything other than “i” or “j”)
Fix:
- Validate numeric inputs
- Use only “i” or “j”
Unexpected formatting
Cause:
- Imaginary part negative → auto‑formatted as subtraction
Fix:
- This is expected behavior
Best Practices ▾
- Use COMPLEX to construct valid inputs for IM* functions
- Use
"j"for electrical engineering workflows - Keep real and imaginary parts in separate cells for clarity
- Use IMABS, IMARG, IMSUM, IMDIV, etc., for further operations
- Avoid mixing COMPLEX strings with numeric arithmetic
COMPLEX is the gateway to Calc’s entire complex‑number ecosystem — once you construct the number, every IM* function becomes available.
Related Patterns and Alternatives ▾
- IMREAL / IMAG — extract components
- IMABS — magnitude
- IMARG — phase angle
- IMCONJUGATE — conjugate
- IMSUM / IMPRODUCT / IMDIV — arithmetic
- IMSQRT — square root of complex numbers
By mastering COMPLEX, you can build powerful engineering, signal‑processing, and mathematical models in LibreOffice Calc.