IMSQRT
Returns the principal square root of a complex number.
Computes the root in polar form and returns complex text.
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
=IMSQRT(inumber)
Arguments
| Argument | Type | Required | Default |
|---|---|---|---|
inumber | any | Required | — |
Return type
Can return text.
How it works
For a nonzero z with magnitude r and principal angle θ, the principal square root has magnitude √r and angle θ/2. Zero has square root zero.
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
- Input is coerced to complex-number text before parsing.
- Returns the principal branch of the square root.
Error cases
- Invalid complex text returns
#NUM!.
Examples
Find the principal square root of 3 + 4i, with magnitude √5.
Formula =IMSQRT("3+4i")
Expected result 2+i
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?.
Reflect the principal root into the lower half-plane.
Formula =IMSQRT("3-4j")
Expected result 2-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?.
Real one has principal square root one.
Formula =IMSQRT("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 take the principal square root.
Formula =IMSQRT("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?.
Square root of a negative real
Formula =IMSQRT("-4")
Expected result 2i
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 square root does IMSQRT return for complex inputs?
It returns the principal branch (half-angle polar form), matching spreadsheet-style principal-value behavior.