Home » Excel-Built-In-Functions » Excel-Engineering-Functions » Excel-Imsub-Function

# The Excel IMSUB Function

Subtracting Complex Numbers

When subtracting complex numbers, the real and imaginary coefficients are subtracted separately.

I.e. the equation to subtract complex number c+di from complex number a+bi is:

(a+bi) - (c+di) = (a-c) + (b-d)i

Complex Numbers are explained in detail on the Wikipedia Complex Numbers Page.

Related Function:

IMSUM Function## Basic Description

The Excel Imsub function calculates the difference between two complex numbers (i.e. subtracts one complex number from another).

The syntax of the function is:

IMSUB( inumber1, inumber2 )

where the inumber arguments are Complex Numbers, and you want to subtract inumber2 __from__ inumber1.

### Complex Numbers in Excel

Note that complex numbers are simply stored as text in Excel. When a text string in the format "a+bi" or "a+bj" is supplied to one of Excel's built-in complex number functions, this is interpreted as a complex number.

Also the complex number functions can accept a simple numeric value, as this is equivalent to a complex number whose imaginary coefficient is equal to 0.

Therefore, the inumber arguments can be supplied to the Excel Imsub function as either:

- Simple numbers;
- Complex numbers encased in quotation marks - e.g. "5+3i";
- References to cells containing complex numbers or numeric values;
- Values returned from other Excel functions or formulas.

## Imsub Function Examples

In the spreadsheet below, the Excel Imsub function is used find the difference between three different pairs of complex numbers.

Formulas: | A | B |
---|
1 | 5+i | =IMSUB( A1, A2 ) |
---|
2 | 1+4i | =IMSUB( "9+2i", 6 ) |
---|
3 | | =IMSUB( COMPLEX( 5, 2 ), COMPLEX( 0, 1 ) ) |
---|
| Results: |

Note that, in the above example spreadsheet:

- The integer 6, used in cell B2, is equal to the complex number 6+0i;
- The example in cell B3 uses the Excel Complex Function to create the complex numbers 5+2i and i.

Further details of the Excel Imsub function are provided on the Microsoft Office website.

## Imsub Function Errors

If you get an error from the Excel Imsub function, this is likely to be one of the following:

Common Errors

#NUM! | - | Occurs if one or both of the supplied inumber arguments are not recognised as complex numbers. |

#VALUE! | - | Occurs if one or both of the supplied inumber arguments are logical values. |