Formualizer Docs

IMSUB

Returns the difference between two complex numbers.

Subtracts the second complex value from the first.

The Formualizer engine in this repository at 0.15.0 plus unreleased changes computes the example results. Known differences from Excel are listed on this page.

Syntax

=IMSUB(inumber1, inumber2)

Arguments

ArgumentTypeRequiredDefault
inumber1anyRequired—
inumber2anyRequired—

Return type

Can return text.

How it works

Subtract corresponding components to get (a − c) + (b − d)i. Subtraction is defined for every pair of complex numbers.

Differences from Excel

The raw Formualizer text can contain more significant digits than Excel’s complex-number text. The examples round each coefficient to 15 significant digits for display.

Remarks

  • Inputs are coerced to complex-number text before parsing.

Error cases

  • Preserves an explicit i or j suffix when present (defaulting to i when both operands are purely real), and returns #VALUE! when explicit i and j suffixes are mixed.
  • Invalid complex text returns #NUM!.

Examples

Subtract the real and imaginary components of two complex numbers.

Formula =IMSUB("3+4i","1+i")

Expected result 2+3i

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Subtract a purely real value from a j-suffixed complex value.

Formula =IMSUB("3+4j","2")

Expected result 1+4j

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Equal complex values cancel both coefficients.

Formula =IMSUB("1+i","1+i")

Expected result 0

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

The second argument cannot be parsed as a complex value.

Formula =IMSUB("1+i","invalid")

Expected result #NUM!

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Subtract a+bi values

Formula =IMSUB("5+3i","2+i")

Expected result 3+2i

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

FAQ

How is subtraction ordered in IMSUB?

It always computes inumber1 - inumber2; swapping arguments changes the sign of the result.

Implementation

Engine source

On this page