IMSUB Function (OpenOffice Calc)
Subtract complex numbers in Apache OpenOffice using two arguments, with sign-sensitive examples and strict empty-text diagnostics.
Verification status: Eight reference formulas and 3 diagnostic cases were recalculated in Apache OpenOffice 4.1.16 on Linux x86-64, Build 9816, using XLSX import and GUI hard recalculation. Saved formula identities and typed results were checked. How formula examples are checked
Quick answer: =IMSUB("3+4i";"1-2i") returned 2+6i in the tested Apache OpenOffice 4.1.16 build.
Availability and version history
- Introduced: First release not established; documented by OpenOffice.org 3.3.
- Supported in: Apache OpenOffice 4.1.16; this identifies a verified release, not a final supported version.
- Scope: Desktop Calc with its Analysis add-in, English function names and semicolon-separated formulas.
- Checked: October 14, 2026. Eight reference formulas and the listed diagnostics were recalculated after XLSX import in 4.1.16 on Linux x86-64, Build 9816. Source and independent reference calculations were also checked.
What IMSUB returns
IMSUB returns the complex difference of two arguments. The first is the minuend and the second is subtracted from it. Real and imaginary components are subtracted separately, and the returned value is formatted complex-number text. Release entry.
Syntax and arguments
=IMSUB(Minuend; Subtrahend)
Exactly two complex-number arguments are required. Valid inputs include parsed complex strings and pure real forms. Lowercase i or j denotes the imaginary unit. Unlike IMSUM, this fixed-argument operation constructs each complex value directly; it does not collect and skip empty list entries.
Reproducible examples
The native column records the saved 4.1.16 results. The native strings are retained exactly. Independent component references are rounded to twelve decimal places, with rounded negative zero shown as zero. A tiny stored residual can therefore appear in the native string beside a reference component rounded to zero. Every successful result below is string-typed, including pure real-looking outputs.
| Formula | Native 4.1.16 string | Independent (real, imaginary) reference |
|---|---|---|
=IMSUB("3+4i";"1-2i") |
2+6i |
(2, 6) |
=IMSUB("3-4i";"1+2i") |
2-6i |
(2, -6) |
=IMSUB("-3+4i";"2+i") |
-5+3i |
(-5, 3) |
=IMSUB("-3-4i";"2-i") |
-5-3i |
(-5, -3) |
=IMSUB("1";"2") |
-1 |
(-1, 0) |
=IMSUB("i";"2i") |
-i |
(0, -1) |
=IMSUB("-1";"i") |
-1-i |
(-1, -1) |
=IMSUB("0.5+0.25i";"0.25-0.5i") |
0.25+0.75i |
(0.25, 0.75) |
Practical worksheet
=IMSUB("3+4i";"1-2i") returns 2+6i: subtracting −2i increases the imaginary component. Reversing the operands changes the sign of the whole answer. Label the two inputs clearly when calculating a complex residual or difference between a measurement and a reference.
A worksheet can store the observed value in A2 and the reference in B2, then use =IMSUB(A2;B2). This is an illustrative layout for the tested literal values. Ordinary subtraction of text cells is not interchangeable with the IM operation.
Advanced interpretation and checks
For z=a+bi and w=c+di, z−w=(a−c)+(b−d)i. The identity (z−w)+w=z provides a mathematical round-trip check. For the first example, (2+6i)+(1−2i)=3+4i.
Subtraction is not commutative: w−z=−(z−w). It also need not reduce magnitude. Here |2+6i|=√40≈6.324555320, which is larger than the original magnitude 5 because the imaginary components point in opposite directions.
Near cancellation, a small result can have a large relative error even if both inputs have small absolute errors. Retain sufficient input precision and compare an appropriate absolute tolerance rather than dividing by a nearly zero residual.
Boundaries and troubleshooting
The three-argument diagnostic is an arity error, not a request to subtract two later arguments successively. Use nested two-argument formulas when a multi-step difference is intended.
Invalid complex text and an empty string are rejected in the tested path. This differs from the empty-entry handling in the variadic collection functions. A numeric-looking returned string is still a complex representation; formatting conventions may omit a zero component or a unit coefficient.
These additional formulas were recalculated through the same import path. Error displays are retained as errors, even when an ODS numeric attribute stores zero.
| Formula | Observed result or error |
|---|---|
=IMSUB("abc";2) |
Err:502 |
=IMSUB("";2) |
Err:502 |
=IMSUB(3;2;1) |
Err:504 |
Other spreadsheet implementations
The IMSUB guide for Calligra Sheets documents that product’s own syntax and tested behavior. A shared function name does not guarantee the same argument conversion, text parsing, branch or precision rules.
Official evidence and checking scope
- Function-specific release entry
- Complex algorithm or collection helper
- Strict complex-string parser
- Finite-output string formatter
The saved ODS retained every tested formula identity. A deliberately stale SUM cache changed from 999999 to 3, and an uncached SUM returned 7 after hard recalculation. Native evidence covers the eight reference formulas and listed diagnostics only. Other explanatory compositions are independent mathematical checks; other releases, locales and extreme-value behavior were not established by this run.