COMPLEX
Builds a complex number text value from real and imaginary coefficients.
Returns canonical text such as 3+4i or -2j.
The Formualizer engine in this repository at 0.15.0 plus unreleased changes computes the example results. Known differences from Excel are listed on this page.
Syntax
=COMPLEX(real_num, i_num, [suffix])
Arguments
| Argument | Type | Required | Default |
|---|---|---|---|
real_num | any | Required | — |
i_num | any | Required | — |
suffix | any | Optional | — |
Return type
Can return text.
How it works
Builds the text representation of a + bi or a + bj from real coefficients a and b. The suffix must be i or j.
Differences from Excel
The raw Formualizer text can contain more significant digits than Excel’s complex-number text. The examples round each coefficient to 15 significant digits for display.
Remarks
real_numandi_numare numerically coerced.suffixmay be"i","j", empty text, or omitted; empty/omitted defaults toi.
Error cases
- Any other suffix returns
#VALUE!.
Examples
Build complex text with nonzero real and imaginary coefficients.
Formula =COMPLEX(3,4)
Expected result 3+4i
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Use j as the imaginary-unit suffix.
Formula =COMPLEX(3,4,"j")
Expected result 3+4j
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Combine two zero coefficients.
Formula =COMPLEX(0,0)
Expected result 0
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Only supported imaginary-unit suffixes can be used.
Formula =COMPLEX(3,4,"k")
Expected result #VALUE!
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Build with j suffix
Formula =COMPLEX(0,-1,"j")
Expected result -j
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Related functions
FAQ
Which suffix values are valid in COMPLEX?
Only suffixes i or j are accepted (empty or omitted defaults to i); other suffix strings return #VALUE!.