Contact

IMSUB in Excel: Calculate Complex Residuals and Check Subtraction Order

Engineering Intermediate Microsoft Excel

Subtract complex values in Excel, verify signed residual components and distances, and use explicit parentheses when subtracting several contributions.

Verification status: See the evidence and test scope described in this guide. How formula examples are checked

Quick answer: IMSUB(inumber1,inumber2) subtracts the second complex value from the first. Both arguments are required, and reversing them reverses both result components.

Availability and version history

  • Introduced: the first introduction version is not established by the reviewed official history.
  • Availability: official help lists Excel for Microsoft 365, Excel for Microsoft 365 for Mac, Excel 2024, Excel 2024 for Mac, Excel 2021, Excel 2021 for Mac, Excel 2019, Excel 2016.
  • Checked: October 14, 2026; official IMSUB reference. Documentation and independent models; no native Excel execution or wider platform certification.

Syntax and the subtraction equation

=IMSUB(inumber1,inumber2)

Microsoft identifies the first argument as the value from which the second is subtracted. Its equation image subtracts corresponding coefficients: (a+bi)−(c+di)=(a−c)+(b−d)i.

The inputs use complex i or j notation. COMPLEX can build them from numeric coefficient cells. For a multi-input complex calculation, keep the imaginary suffix consistent, as the separate COMPLEX reference requires.

The dedicated IMSUB page does not give a complete parsing, blank or invalid-type error table. The examples therefore use explicit valid complex strings and do not infer general coercion from ordinary numeric subtraction.

Example 1: calculate observed-minus-expected residuals

Enter only the first two text columns in A1:B4. Put =IMSUB(A2,B2) in C2 and fill through C4; the last column below shows the expected result.

A, observed B, expected C, residual
5+7i 2+3i 3+4i
-1+6i 2-2i -3+8i
4-5i -2+i 6-6i

For the second row, the real difference is −1−2=−3 and the imaginary difference is 6−(−2)=8. Subtracting a negative coefficient increases that component.

A residual is directional. Labeling the columns Observed and Expected makes the sign convention reproducible rather than leaving the reader to guess which value was subtracted.

Example 2: verify components independently

In D2 use =IMREAL(A2)-IMREAL(B2) and in E2 use =IMAGINARY(A2)-IMAGINARY(B2), filling through row 4.

Expected real differences are 3, −3 and 6. Expected imaginary differences are 4, 8 and −6. Compare them with the corresponding components extracted from C2:C4.

IMREAL and IMAGINARY return the numeric helpers. The reconstruction =COMPLEX(D2,E2) has the same expected complex quantity as C2 for each record.

This checks the complete subtraction, not just its magnitude or one component. Two different residuals can have the same distance from zero.

Advanced example: reverse the direction and compare distances

=IMSUB(B2,A2) gives −3−4i for the first record, the negative of the observed-minus-expected residual. The distance is unchanged:

=IMABS(IMSUB(A2,B2))
=IMABS(IMSUB(B2,A2))

Both have expected result five. For the other two records, residual magnitudes are the square root of 73 and the square root of 72, approximately 8.544003745 and 8.485281374.

IMABS removes direction and keeps length. Use signed coefficients when a report needs the direction of a discrepancy, and magnitude when it needs a distance.

Advanced example: subtract several contributions explicitly

Let P=4+3i, Q=1−2i and R=−2+i. Subtracting both Q and R from P can be written as:

=IMSUB(IMSUB("4+3i","1-2i"),"-2+i")

Expected result: 5+4i. The first subtraction gives 3+5i; subtracting −2+i then adds two to the real component and removes one from the imaginary component.

The equivalent expression =IMSUB("4+3i",IMSUM("1-2i","-2+i")) subtracts the combined contribution −1−i and also gives 5+4i.

But =IMSUB("4+3i",IMSUB("1-2i","-2+i")) gives 1+6i. It subtracts Q−R, so R is effectively added. Parentheses change the operation; subtraction is not associative.

Advanced example: center a small complex dataset

Consider 1+i, 3+5i and 5+3i. Their real and imaginary means are both three, so the center is 3+3i.

Subtract that center from each record with IMSUB. The expected component pairs are (−2,−2), (0,2) and (2,0). Each component column sums to zero.

This is an independent centering control. It does not imply that averaging magnitudes would give the same center, or that every residual’s magnitude is zero. The three centered distances are the square root of eight, two and two.

Recovery check and input limits

For the first residual table, =IMSUM(C2,B2) recovers the expected observed quantity 5+7i. Filling down recovers −1+6i and 4−5i. IMSUM adds the subtracted contribution back.

All these identities use exact small coefficients. Floating-point inputs with very different scales may need a stated tolerance rather than exact text comparison, and simplified zero-component output does not establish a storage TYPE.

Malformed strings, mixed suffix errors, blank coercion and native error precedence remain unverified. The outputs were independently calculated from the documented subtraction equation, with no native Excel execution.

References and verification

Expected outputs are independently calculated examples or documented rules, not captured native Excel results. Formulas use English function names and comma argument separators. Locale, rendering and boundary restrictions are stated where relevant.