IMSUB Function in LibreOffice Calc — Tested Examples
Subtract complex numbers in LibreOffice Calc with IMSUB. Preserve order, use accepted i/j text, check a two-column phasor dataset and distinguish Calc suffix behavior.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: IMSUB subtracts the second complex number from the first, component by component. Quote complex literals; leave cell references unquoted.
Availability and version history
- Introduced: Documented by LibreOffice 26.8.1.1; original introduction not established.
- Availability: Supported in LibreOffice 26.8.1.1, verified against its function registry. This identifies a supported release, not a final working version.
- Scope: Desktop Calc, using the English function name. Availability in other spreadsheet applications is separate.
- Checked: 2026-10-14 — function reference; versioned support. Documentation/source check; not a new native test. Existing example-specific test claims below retain their stated scope.
Returns the difference of two complex numbers. Complex subtraction is component-wise: (3+4i)−(1+2i)=2+2i.
Syntax and arguments
=IMSUB(Complex_number_1; Complex_number_2)
LibreOffice Calc formulas generally separate arguments with semicolons (;).
| Argument | Explanation |
|---|---|
Complex number 1 |
Required minuend: complex-number text or a reference containing it. |
Complex number 2 |
Required subtrahend, deducted from the first input. |
Worked examples
Example 1: Subtract two complex values
=IMSUB("3+4i";"1+2i")
Expected result: 2+2i. This value was returned in the LibreOffice Calc 25.2 test.
Example 2: Subtract complex components
=IMSUB("3+4i";"1+1i")
Expected result: 2+3i. This value was returned in the LibreOffice Calc 25.2 test.
How to interpret the result
Complex subtraction is component-wise: (3+4i)−(1+2i)=2+2i.
Mistakes and troubleshooting
- Check inputs and assumptions: Subtraction order matters. Reversing the two arguments changes the sign.
- Check argument order and format: Strings go in quotes, cell references do not. Functions that return arrays may require special entry.
- Verify your own data: Reproduce the example first. If your formula returns an error, inspect the referenced cells and individual argument values.
Additional worked application and edge cases
Accepted complex text and input order
Use a quoted complex literal such as "3+4i", a cell containing that text, or text created by COMPLEX. Lowercase i and j are accepted imaginary-unit symbols. The pinned Calc parser also accepts pure real text such as "2" and pure imaginary text such as "3i"; uppercase I/J are not accepted by that parser.
The result is complex-number text, not an ordinary numeric scalar. Use the IM* functions to process it rather than assuming ordinary subtraction or division of text will implement complex arithmetic. The formatter can omit a zero component or an imaginary coefficient of 1, so 8+j and the mathematical form 8+1j describe the same result.
Stepwise application: residual between two phasors
Put measured values 12+7i, 5-2i and 3i in A2:A4, and reference values 4+3i, 2+4i and 1+i in B2:B4. Enter =IMSUB(A2;B2) in C2 and copy down.
| Row | Expected result | Component check |
|---|---|---|
| 2 | 8+4i | (12−4)+(7−3)i |
| 3 | 3-6i | (5−2)+(−2−4)i |
| 4 | -1+2i | (0−1)+(3−1)i |
These new values are independently calculated. In row2, reversing the formula to =IMSUB(B2;A2) gives -8-4i. That sign reversal is why the first argument must consistently represent the measured value when the output is labeled a measured-minus-reference residual.
Advanced check: residual magnitude
For C2 equal to 8+4i, =IMABS(C2) is expected to return approximately 8.94427191, the square root of 8²+4². This is the residual’s magnitude, not the difference between the two input magnitudes. Keep the real and imaginary components if their directions matter.
Mixed suffixes and parsing limits
Do not import another spreadsheet’s mixed-suffix error rule into Calc without evidence. In the inspected 26.8.1.1 source, subtraction operates on the numeric components and retains the first operand’s explicit suffix, adopting the second only when the first has no suffix. Thus source inspection predicts =IMSUB("3+4i";"1+2j") as 2+2i. This is a source-derived expectation, not a fresh native test. Consistent suffixes remain the clearer and more portable input choice.
Malformed text, an unsupported suffix or an incomplete numeric component is rejected by the complex parser. Avoid decorative spaces, locale-formatted currency text and labels inside a complex string. The precise application display of every malformed-input error has not been newly tested.
- Calc complex parsing and formatting source, inspected October 17, 2026.
- Calc component subtraction and suffix selection, inspected October 17, 2026.
Verification scope for this addition: These added results were independently calculated or derived from the cited documentation/source. They were not newly tested in LibreOffice Calc. The original example-specific Calc 25.2.3.2 claims elsewhere on this page remain historical and apply only to those original examples. The cited 26.8.1.1 source tag is a code reference, not a claim of a new run in that release.
Related functions
Tested version and primary reference
2 example(s) on this page passed real calculations in LibreOffice Calc 25.2.3.2. This is not a claim about every possible input or other spreadsheet applications.