IMREAL
Returns the real coefficient of a complex number.
Accepts complex text (for example a+bi) or numeric values.
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
=IMREAL(inumber)
Arguments
| Argument | Type | Required | Default |
|---|---|---|---|
inumber | any | Required | — |
How it works
For z = a + bi, the result is a. A purely imaginary input has real coefficient zero.
Remarks
- Inputs are coerced to complex-number text before parsing.
- Purely imaginary values return
0.
Error cases
- Invalid complex text returns
#NUM!.
Examples
Read the real coefficient of 3 + 4i.
Formula =IMREAL("3+4i")
Expected result 3
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?.
The real coefficient stays three when the imaginary part changes sign.
Formula =IMREAL("3-4j")
Expected result 3
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?.
Read the coefficient of a purely real value.
Formula =IMREAL("1")
Expected result 1
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?.
The text “invalid” has no complex value from which to extract the real coefficient.
Formula =IMREAL("invalid")
Expected result #NUM!
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?.
Real part of pure imaginary
Formula =IMREAL("5j")
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?.
Related functions
FAQ
What does IMREAL return for a purely imaginary input?
It returns 0 because the real coefficient is zero.