This guide will explain how to use the IMSUB function in Google Sheets.
Table of Contents
Complex numbers are defined as a combination of a real and imaginary number. These numbers are expressed in the form a+bi, where a is a real number and bi is an imaginary number.
When subtracting complex numbers, we must consider the real and imaginary parts separately. Since the default operators in Google Sheets do not support imaginary numbers, we’ll need to use the built-in IMSUB
function.
In this guide, we will provide a step-by-step tutorial on how to subtract two complex numbers using the IMSUB
function in Google Sheets.
The Anatomy of the IMSUB Function
The syntax of the IMSUB
function is as follows:
=IMSUB(first_number, second_number)
Let’s look at each argument to understand how to use the IMSUB
function.
- first_number refers to the complex number you want to subtract the second number from.
- second_number refers to the complex number you want to subtract from the first number.
- The
IMSUB
function will only subtract numbers if they have the same suffix. For example, the formula IMSUB(“3+2i”, “6+3j”) will result in an error. - If the user inputs a real number, the
IMSUB
function will treat the input as a complex number with an imaginary part equal to 0.
The Anatomy of the COMPLEX Function
The syntax of the COMPLEX
function is as follows:
=COMPLEX(real_part, imaginary_part, [suffix])
Let’s look at each argument to understand how to use the COMPLEX
function.
- real_part refers to the real coefficient of the complex number.
- imaginary_part refers to the imaginary coefficient of the complex number
- suffix is an optional argument where the user can indicate the suffix to use for the imaginary coefficient. By default, the value for this argument is “i”.
A Real Example of Using the IMSUB Function
Suppose you want to subtract the complex number 2+i from 5+2i. Calculating the difference between two complex numbers follows the following formula:
(a+bi) - (c+di) = (a - c) + (b - d)i
Thus, we can express (5+2i) – (2+i) into the following expression:
(5-2) + (2-1)i
Simplifying the expression above will give the final answer of 3+i.
Now that we know how complex numbers are subtracted, let’s explore a few basic examples of the IMSUB
function in use.
Using arguments in the form a+bi
The IMSUB
function lets us quickly find the difference between two complex numbers. To subtract 2+i from 5+2i, we can use the formula IMSUB(“5+2i”,”2+i”).

Using IMSUB
, we also arrived at the answer 3+i. Note that complex numbers in the form a+bi should be entered as strings.
Using cell references
We can also use cell references as input for the IMSUB
function. For example, we can use the following formula to subtract a complex number in cell B2 from a complex number in cell A2:
=IMSUB(A2,B2)

The formula will return the difference as long as both cell references contain valid complex numbers and use the same suffix.
Using COMPLEX function
Another way to represent complex numbers in Google Sheets is with the COMPLEX
function. This function takes the real and imaginary coefficients and outputs a complex number with those coefficients. For example, instead of typing “3+2i”, we can use the formula COMPLEX(3,2).
The output of the COMPLEX
function is also considered a valid complex number by the IMSUB
function. Instead of using IMSUB(“5+2i”,”2+i”), we can use the following formula instead:
=IMSUB(COMPLEX(5,2), COMPLEX(2,1)

Using the IMSUB
and COMPLEX
functions together, we’re able to find the difference of two complex numbers by specifying the coefficients of each complex number.
Click on the link below to create your own copy of our examples.
Head to the next section to read our step-by-step tutorial on how to use the IMSUB
function in Google Sheets.
How to Use the IMSUB Function in Google Sheets
- Select the cell where you want to output the difference between two complex numbers.
In this example, we have complex numbers in cells A2 and B2. We want to output the difference between these two numbers in cell C2.
- Type the IMSUB function and add the cell references containing complex numbers as arguments.
Do note that order matters in subtraction. The first argument will always be the number you’ll be subtracting from.
- Hit the Enter key to evaluate the function. In this example, we’ve determined that (4+3i)-( 2+2i) = 2+i.
If the suffixes for each complex number are different, the
IMSUB
function will return a #NUM! error.
These steps are all you need to know to start using theIMSUB
function in Google Sheets.
FAQs
- What other operations can I use in Google Sheets for complex numbers?
Google Sheets comes with several built-in functions to help perform basic operations with complex numbers. TheIMSUM
function can be used to add two or more complex numbers together. TheIMPRODUCT
function allows you to multiply two or more complex numbers, while theIMDIV
function returns the result of dividing one complex number by another. TheIMABS
function allows users to return the absolute value of a complex number.
To learn more about functions for complex numbers, you can read our post on how to find the tangent of a complex number with the IMTAN
function.
That’s all for this guide! Check out our library of spreadsheet resources, tips, and tricks!
