IMSUB function
Subtracts one complex number from another, for example "13+4i" minus "5+3i" gives "8+i".
Available in Excel 2007 and later (Excel 2003 needed the Analysis ToolPak add-in), Microsoft 365, Excel for the web, Excel for Mac
Excel 2007 and laterWorks in Google Sheets
Syntax
IMSUB(inumber1, inumber2)| Argument | What it means | |
|---|---|---|
inumber1 | Required | The complex number to subtract from. |
inumber2 | Required | The complex number to subtract. |
Returns: A complex number as text.
How IMSUB works
IMSUB subtracts the second complex number from the first, part by part: real minus real and imaginary minus imaginary. It is needed because the ordinary minus sign does not work on complex text.
Use it to find the voltage across a component (supply phasor minus the drop elsewhere), the difference between two vectors, or the error between a measured and a modelled response. Like all IM functions, it reads complex numbers written as text (x+yi or x+yj) and returns its answer as text with up to 15 significant digits, so you can feed the result straight into another IM function.
Examples
1Subtract complex numbers
| A | B | C | |
|---|---|---|---|
| 1 | z1 | z2 | |
| 2 | 13+4i | 5+3i | 8+i |
Result: 8+i
13 − 5 = 8 and 4 − 3 = 1, so the result is 8+i.
2Voltage left for the load
| A | B | C | |
|---|---|---|---|
| 1 | Supply (V) | Cable drop (V) | |
| 2 | 230 | 6.5+2.1i | 223.5-2.1i |
Result: 223.5-2.1i
A real 230 V supply minus a cable drop of 6.5+2.1i volts leaves 223.5−2.1i volts across the load; =IMABS(C2) gives its magnitude.
Common errors and how to fix them
| Error | Why it happens | Fix |
|---|---|---|
#NUM! | The text is not a valid complex number — for example it contains spaces (3 + 4i), a capital I, or a misplaced sign. | Create the value with COMPLEX or remove spaces with SUBSTITUTE. |
#VALUE! | The argument is a logical value, or the formula mixes the i and j suffixes. | Use one suffix consistently throughout a calculation. |
Tips
- IMSUB takes exactly two arguments. To subtract several, use
=IMSUB(A2, IMSUM(B2:B5)).
Google Sheets
IMSUB also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.
IMSUB in other languages
In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.
| Language | Function name |
|---|---|
| Danish | IMAGSUB |
| Dutch | C.VERSCHIL |
| Finnish | KOMPLEKSI.EROTUS |
| French | COMPLEXE.DIFFERENCE |
| Hungarian | KÉPZ.KÜL |
| Italian | COMP.DIFF |
| Polish | RÓŻN.LICZB.ZESP |
| Portuguese (Brazil) | IMSUBTR |
| Portuguese (Portugal) | IMSUBTR |
| Russian | МНИМ.РАЗН |
| Spanish | IM.SUSTR |
| Swedish | IMDIFF |
| Turkish | SANTOPLA |