Contact

IMSQRT in ONLYOFFICE: Complex Square Roots with Reproducible Examples

Engineering Intermediate ONLYOFFICE Spreadsheet Editor

Solve the principal square root of a complex input in ONLYOFFICE, with a cell-by-cell engineering worksheet, branch cases and debugging.

Verification status: Official documentation referenced; example outcomes independently reasoned or arithmetically checked where stated. Not executed in ONLYOFFICE Spreadsheet Editor. How formula examples are checked

Quick answer: =IMSQRT(inumber) calculates a square root of a complex number. The official function page states IMSQRT(inumber) and accepts complex numbers in x+yi or x+yj form. To compute a square root of 3+4i, a test formula is =IMSQRT(COMPLEX(3,4)). The mathematical expected result is 2+i, because (2+i)²=3+4i. This is not a screenshot or native editor observation. Vendor function definition; COMPLEX constructor.

Purpose: why a complex square root needs IMSQRT

Real-only SQRT is documented as returning #NUM! for a negative real input; IMSQRT is for the complex-number representation and can produce an imaginary component. A complex number has the form a+bi or a+bj. For electrical engineering, signal processing and mathematical transformations, you often need a consistent branch for a square root of an impedance-like complex quantity. Do not discard the imaginary coefficient or silently replace a complex calculation with a real-only function. The official references define these functions separately: SQRT and IMSQRT.

Mathematically, the usual principal square root chooses a result with nonnegative real component, and a sign of the imaginary component determined by the original argument away from branch-cut ambiguities. This is a mathematical convention used to calculate the examples; the vendor’s brief function page does not explicitly specify branch-cut rules or signed-zero handling. Those runtime details still require testing.

Exact syntax, type and defaults

=IMSQRT(inumber)
Position Argument Required? Documented type Default
1 inumber Yes One complex number in x+yi or x+yj form, or a cell referring to it. None; no optional argument documented.

The function does not accept separate real and imaginary coefficients as two arguments. Build the single complex input with =COMPLEX(B2,C2) (vendor syntax: COMPLEX(real_num, i_num, [suffix]); suffix defaults to lowercase i and can be lowercase j). Quoted string literals such as "3+4i" are structurally different from unquoted spreadsheet expressions. The vendor function page does not enumerate every accepted text-conversion edge case. COMPLEX documentation.

Before entering formulas: reproduce the test worksheet

  1. Create a blank spreadsheet in an ONLYOFFICE Spreadsheet Editor edition you can identify. Use English formula language for the formulas below. Record your Desktop version or the actual Docs/server version and your region if you later report test results.
  2. Enter the specified headers, then enter the table’s input values in the exact cells shown. Numeric inputs must be numeric cells (without quote marks). For complex inputs, use the documented COMPLEX constructor as directed.
  3. Enter the formulas into the output cells exactly as shown, beginning with =. Use Formula → Function to find IMSQRT or type the function directly. Fill down only through the named last row; do not accidentally include table headers.
  4. Compare your displayed values against the independently computed expected column. For decimals, change display format or use numeric tolerance rather than expecting identical trailing digits. For complex outputs, extract real and imaginary coefficients separately.
  5. If your result differs, record the formula, underlying cell type, software platform/version, displayed result, separator/locale settings and any error without overwriting the expected-value reference. ONLYOFFICE’s formula-entry and recalculation guide describes recalculating via the Formula tab, or F9 for the workbook.

Set A1:I1 to Case, Real, Imaginary, Constructed complex, IMSQRT result, Expected real, Expected imaginary, Extracted real, Extracted imaginary. Put the B/C numeric coefficients shown below in rows 2–14, then enter =COMPLEX(B2,C2) into D2 and fill through D14. Put =IMSQRT(D2) into E2, fill E14. Enter the listed expected coefficients numerically in F/G. Use the vendor-documented =IMREAL(E2) in H2 and =IMAGINARY(E2) in I2 and fill to row 14. In J2, =AND(ABS(H2-F2)<0.00001,ABS(I2-G2)<0.00001) is a proposed numeric tolerance check, not a verified native result.

Reproducible input data and expected results

Row Case (A) B: real coefficient C: imaginary coefficient F: expected real of IMSQRT G: expected imaginary
2 Zero 0 0 0 0
3 Positive 1 1 0 1.000000000 0
4 Positive 4 4 0 2.000000000 0
5 Positive 9 9 0 3.000000000 0
6 Negative 1 -1 0 0 1.000000000
7 Negative 4 -4 0 0 2.000000000
8 3 + 4i 3 4 2.000000000 1.000000000
9 3 - 4i 3 -4 2.000000000 -1.000000000
10 -3 + 4i -3 4 1.000000000 2.000000000
11 -3 - 4i -3 -4 1.000000000 -2.000000000
12 Positive imaginary 0 4 1.414213562 1.414213562
13 Negative imaginary 0 -4 1.414213562 -1.414213562
14 Fractional complex 0.5 0.5 0.776886987 0.321797126

The complex output in column E might be displayed using i or j, with variable decimal formatting; no actual display strings were observed. The F/G columns contain mathematical expected coefficients, cross-checked with two independent complex arithmetic implementations. The last row is 14: do not accidentally compare against a header.

Two quick direct formulas

=IMSQRT(COMPLEX(3,4))
=IMSQRT(COMPLEX(-3,-4))

The first mathematically equals 2+i, and the second 1−2i. Check the coefficients rather than relying on text formatting. For a j-suffix construction, use =COMPLEX(3,4,"j") before passing that one argument to IMSQRT; j is vendor-documented for the constructor, but native propagation/display has not been tested here.

Advanced cross-checks: squaring the answer and preserving magnitude

Square it back: =IMPRODUCT(E2,E2) is a documented way to multiply complex values. Mathematically, the result equals the original D2, up to numeric error. To compare precisely, extract IMREAL and IMAGINARY from both values. For the 3+4i row, multiplying 2+i by itself yields 3+4i. IMPRODUCT; IMREAL; IMAGINARY.

Magnitude identity: the magnitude of a square root satisfies |sqrt(z)|²=|z|. If your sample is in D8 and its expected square root in E8, compare the two numeric expressions =IMABS(E8)^2 and =IMABS(D8); each is expected to equal 5 for 3+4i. IMABS returns complex magnitude, not the same as taking the absolute value of just the real coefficient. IMABS.

Principal-branch derivation: Let z=a+bi, r=sqrt(a²+b²). For nonzero b, u=sqrt((r+a)/2) and v=sign(b) sqrt((r-a)/2). Then sqrt(z)=u+vi. At a negative real with imaginary coefficient zero, the principal result is positive imaginary, for example sqrt(-4)=2i. This formula is a mathematical derivation and is not a claim of observed ONLYOFFICE internal implementation. It also explains why merely applying SQRT(a) to the real part is wrong.

Practical engineering application: track a complex parameter sweep

Create two input columns representing the real and imaginary components of your dimensionless normalized model. Compute COMPLEX, then IMSQRT, and extract the result’s two components. For a sequence from 3+4i to 3−4i, the expected results are conjugates. Comparing both component columns exposes sign mistakes that a formatted complex output might hide. Do not attach units to input strings such as "3 V+4i"; keep units in a separate header. Flag values near negative real branch boundaries for further native verification, where argument representation and finite precision may matter.

Errors, limits and troubleshooting

Symptom or question Likely issue Verification level and recommended next step
Function name not recognized or a #NAME?-style diagnostic Wrong spelling, formula language, or older installed version. Possible diagnostic only: native error message unverified. Search exact IMSQRT in the official function picker. Check target product/version and regional language.
Wrong number of arguments Required versus optional inputs do not match the official signature. Compare directly with vendor syntax; do not infer that another spreadsheet’s argument defaults also apply.
Input stored as text or containing units Numeric-looking text, an invalid complex literal, or an incompatible unit suffix may not be accepted. The function page does not exhaustively document coercion. Enter numeric data in Number/General cells or use documented COMPLEX where appropriate; native conversion and error codes remain untested.
Unexpected zeros, decimals or tiny differences Floating-point arithmetic, formatting, or rounding of a displayed value. Compare underlying numbers using a tolerance; distinguish the mathematical definition from implementation precision.
Different separator or localized name Formula Language and region settings vary. See ONLYOFFICE Advanced Settings; confirm settings in the target editor rather than guessing syntax.
Result looks wrong after editing inputs Recalculation or mistaken relative reference while filling down. Inspect Show Formulas, check absolute/relative references, and recalculate from Formula → Calculation as documented.
Real-only SQRT(-4) fails but IMSQRT is being discussed Mixing a real numeric argument with a complex number in documented form. The SQRT official page documents #NUM! for negative numeric input; this must not be extrapolated into a guaranteed IMSQRT error or output.
Unexpected sign near a negative real or a branch cut Principal complex square root and signed-zero behaviour. Mathematically sqrt(-4)=2i on the usual principal branch, but ONLYOFFICE’s exact branch-cut/signed-zero decisions are not established by its short IMSQRT help page.
Output says i when you expected j Constructor suffix and display formatting. COMPLEX documents i/j suffixes; propagation and display require native editor testing.

Do not invent an error value. Where a case is mathematically defined but the editor’s coercion/overflow handling is undocumented, record it as native behaviour unverified, not a guaranteed #VALUE!, #NUM! or other message.

Use COMPLEX to construct complex inputs, IMREAL and IMAGINARY to extract components, IMABS to inspect magnitude, IMPRODUCT for a round-trip, and SQRT for nonnegative ordinary numeric inputs.

Compatibility, platform, formula language and limitations of this review

Officially documented: The current, unversioned English ONLYOFFICE Docs Spreadsheet Editor function page for IMSQRT and Insert Function catalogue list IMSQRT as an Engineering function. Checked 2026-10-13 (UTC). This supports the existence, purpose and signature of the function in the documented editor; it is not proof of identical behaviour in all past web integrations, all Desktop Editors builds, or mobile versions.

First-supported version: Not established by this research. The vendor maintains distinct Docs release history and Desktop Editors release history. Their availability does not, by itself, identify the first supported release of IMSQRT. Desktop version compatibility: NOT NATIVELY TESTED; browser/web version compatibility: NOT NATIVELY TESTED; historical versions: UNKNOWN; imported workbook round-trip and specific file-format compatibility: NOT TESTED.

English formulas: Examples use an initial = and commas between arguments where necessary, following the official Insert Function instructions. Under File → Advanced Settings, the editor offers Formula Language, Region, and decimal/thousands separators (official Advanced Settings guide). Translated formula names, regional separators and localized decimal entry are not verified here. Do not blindly swap commas for semicolons or translate a function name unless checked in the actual target installation.

Evidence classification: Every result labelled expected is derived from independent mathematical or logical computation, never copied from an ONLYOFFICE screenshot or claimed to have been observed in a running editor. Native Desktop executions: 0. Native web executions: 0. Any error strings described as possible diagnostic are not observed output.

Official sources and claim-level evidence — checked 2026-10-13 UTC

Claim Reference and method Evidence classification
IMSQRT exists and its exact syntax/argument order ONLYOFFICE IMSQRT reference, heading, syntax, argument table; directly checked 2026-10-13. OFFICIAL DOCUMENTATION, current unversioned English Docs reference.
Function picker and English formula syntax ONLYOFFICE Insert Function guide, formula-entry instructions and Engineering category; checked 2026-10-13. OFFICIAL DOCUMENTATION, not a runtime test.
Formula language, region and numeric separators are configurable ONLYOFFICE Advanced Settings, Regional settings; checked 2026-10-13. OFFICIAL DOCUMENTATION, localized names not tested.
Scope of Docs versus Desktop and historical releases Docs changelog; Desktop changelog; checked 2026-10-13. Separate release histories observed; per-function first-supported version not established.
13 numeric/complex comparison cases from the worksheet Standard mathematical definitions cross-checked using independent Python standard-library logic and high-precision mpmath/decimal procedures. INDEPENDENT MATH, not native ONLYOFFICE output.
Complex input creation and lowercase i/j suffix default COMPLEX reference, Syntax/Arguments, checked 2026-10-13. OFFICIAL DOCUMENTATION
Real-only SQRT handling of negative number SQRT reference, Notes, checked 2026-10-13. OFFICIAL DOCUMENTATION; do not transfer error code to IMSQRT
Square-back identity and coefficient extraction IMPRODUCT, IMREAL, IMAGINARY, checked 2026-10-13; algebraic relation independently verified. OFFICIAL FUNCTION EXISTENCE + INDEPENDENT MATHEMATICS