Contact

IMSUB in Google Sheets: Subtract Complex Values and Measure Residuals

Engineering Intermediate Google Sheets

Subtract complex numbers in Google Sheets with reproducible residual tables, component checks and clear subtraction-order examples.

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

Quick answer: IMSUB(first_number,second_number) subtracts the second complex quantity from the first. It subtracts the real coefficients separately from the imaginary coefficients, preserving the direction of the difference.

Availability and version history

  • Introduced: first introduction date is not established by the reviewed official history; no desktop release number is inferred.
  • Availability: documented in the rolling Google Sheets service; these examples use the web worksheet workflow.
  • Checked: October 14, 2026; official IMSUB reference. Documentation and independent models, with no native Sheets execution or wider client certification.

Syntax and the subtraction rule

=IMSUB(first_number,second_number)

Both arguments are required. Google’s documented rule is (a+bi)−(c+di)=(a−c)+(b−d)i. The order matters: reversing the arguments negates both coefficients of the result.

Google explicitly supports complex strings, COMPLEX results and the illustrated numeric real subtraction. Its examples show that subtracting either numeric four or the quoted string “4” from 20+5j yields 16+5j.

Complex operands must use the same i or j suffix. The reference explicitly disallows mixing the two suffixes, but does not identify the exact resulting error code or give a complete input-coercion table.

Example 1: compare observed and target quantities

Enter only the first two columns below as Plain text in A2:B4. In C2 use =IMSUB(A2,B2) and fill down.

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

The second imaginary difference is 5−(−2)=7. The third real difference is 6−(−1)=7. Parentheses make subtraction of a negative coefficient easier to audit.

In D2 enter =IMREAL(C2) and in E2 enter =IMAGINARY(C2), filling down. Expected numeric columns are 5, −3, 7 and 5, 7, −5, respectively.

These are signed residuals, not distances. A negative component indicates direction along that coordinate; it is not automatically an invalid measurement.

Example 2: check the components independently

For the same rows, compare the real helper with =IMREAL(A2)-IMREAL(B2) and the imaginary helper with =IMAGINARY(A2)-IMAGINARY(B2).

All six independent expected component values agree with D2:E4. This checks the selection of both observed and target records without relying solely on the displayed complex string.

Reconstruct a residual with =COMPLEX(D2,E2). Its coefficients match C2. A real-only or pure-imaginary result need not preserve an explicit zero term in the original notation; quantity checks are more useful than raw text equality.

IMREAL and IMAGINARY provide ordinary numeric helper values that can be inspected or summarized separately.

Advanced example: convert residuals into distances

Use =IMABS(C2) in F2 and fill down. Expected distances are approximately 7.071067812, 7.615773106 and 8.602325267, the square roots of 50, 58 and 74.

Reverse the subtraction with =IMSUB(B2,A2). The residuals become −5−5i, 3−7i and −7+5i, but their distances are unchanged.

This distinction matters in reporting: a residual retains direction, whereas its IMABS magnitude retains size only. Taking magnitudes too early prevents reconstruction of the original signed differences.

A squared-distance check avoids square-root displays: =D2^2+E2^2 gives 50 for the first row. For arbitrary noninteger data, compare with an explicit tolerance rather than assuming exact binary equality.

Advanced example: parentheses change repeated subtraction

Let p be 2+5i, q be 3−i and r be −1+2i. To subtract both q and r from p, use:

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

The first difference is −1+6i; subtracting r gives a quantity with real coefficient zero and imaginary coefficient four.

This different formula subtracts the difference q−r:

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

Here q−r is 4−3i, so the final result is −2+8i. Subtraction is not associative. An unexplained change in parentheses can alter both coordinates even when every input is valid.

Advanced example: recover the observed value

For each residual in C2:C4, =IMSUM(C2,B2) reconstructs the corresponding observed quantity in A2:A4. The expected component pairs are (7,8), (−2,5) and (6,−4).

This recovery identity checks both subtraction order and row alignment. It cannot detect an incorrect observation that was already entered consistently in both the calculation and its source; validate the input records separately.

For a simple real adjustment, =IMSUB("20+5j",4) yields 16+5j as documented. Subtracting "4j" instead yields 20+j, changing the imaginary coordinate rather than the real one.

The dedicated reference does not certify general blank handling, malformed strings, range expansion or extreme precision. These examples use explicit scalar operands and small independently checked components; no native Sheets execution was performed.

References and verification

Examples use fictional data, English function names and comma separators. Expected outputs are independent mathematical calculations or explicitly documented rules, not native Sheets captures. Check the spreadsheet locale when reproducing punctuation-sensitive formulas.