How to Use IMAGINARY Function in Google Sheets

The IMAGINARY function in Google Sheets is a mathematical function that returns the imaginary coefficient of a given complex number.

Complex numbers are composed of real and imaginary coefficients in the form a+bi. With the IMAGINARY function, we’ll be able to find out the value of b.

The rules for using the IMAGINARY function in Google Sheets are as follows:

  • The function requires a complex number in the a+bi or a+bj format
  • The function then returns the imaginary coefficient of the given complex number

Let’s take a look at a quick example of when we can use this function.

In this quick example, we have a list of complex numbers that we would like to plot. In mathematics, the real and imaginary coefficients can be used to graph points on a complex plane. The real coefficient corresponds to a position in the x-axis, and the imaginary coefficient represents the y-axis. 

To perform computations on these complex numbers is difficult since these values are treated as text by Google Sheets. With the IMAGINARY function, we can easily retrieve the imaginary coefficient, which can now be used for computation or plotting purposes. Later, we’ll show an example of this in action.

The IMAGINARY function has a complementary function IMREAL, which returns the real coefficient of a complex number. Together, we can later find the x and y coordinates of all our points.

Now that we know when to use the IMAGINARY function, let’s dive into how to actually write the formula and later work on actual complex numbers in a worksheet.



The Anatomy of the IMAGINARY Function

So the syntax (the way we write) the IMAGINARY function is as follows:


Let’s dissect this thing and understand what each of these terms means:

  • = the equal sign is how we start any function in Google Sheets.
  • IMAGINARY() is our IMAGINARY function. It returns the imaginary coefficient of a given complex number.
  • complex_number is the complex number we would like to retrieve the imaginary coefficient from. It comes in the a+bi or a+bj format. 
  • It is possible for complex numbers to not have an imaginary coefficient. For example, =IMAGINARY(“9”) will return a 0.



A Real Example of Using IMAGINARY Function

This section will look at an example of the IMAGINARY function being used in a Google Sheet spreadsheet.

In the table below, we have a table of complex numbers and their coefficients.

Use the IMAGINARY Function in Google Sheets to find the imaginary coefficient of complex numbers

To get the values in cell C2, we just need to use the following formula:


Using this mathematical function allows us to get useful data from our list of complex numbers.

You can make a copy of the spreadsheet above using the link I have attached below. 

Below we have another example of how we can use the IMAGINARY function.

Example of using the IMAGINARY Function in Google Sheets to double complex numbers


In column B, we use the IMAGINARY function to double the imaginary coefficient of the complex numbers in column A. The formula also uses the IMREAL and COMPLEX functions as well to achieve the final result.

If you’re ready to try out the IMAGINARY function in Google Sheets, let’s begin writing it ourselves!



How to Use IMAGINARY Function in Google Sheets

  1. In this example, we have a table where the complex number and real coefficient are already provided. We just need to fill out the imaginary coefficients in Column C.
    To start using the IMAGINARY function, select the cell we will first put our function’s output in. In this example, we’ll start with cell C2.
    Given a complex number, let's find the imaginary coefficient
  2. Next, we just simply type the equal sign ‘=‘ to begin the function, followed by ‘IMAGINARY(‘. 
  3. As seen below, a tooltip box appears with info on the IMAGINARY function. We can click on the arrow on the top-right-hand corner of the box to minimize it if necessary.
    Typing the IMAGINARY Function in Google Sheets into the Formula Bar
  4. The next step is to type in our complex number, which we can do by referencing cell A2.
    Afterward, simply hit Enter on your keyboard to let the function evaluate. 
  5. We can see that the formula works as intended! Drag down the formula to fill out the rest of the table.
    Imaginary Coefficient extracted from our complex number dataset


That’s all you need to know about the IMAGINARY function in Google Sheets. This step-by-step guide shows how simple it is to work with complex numbers in Google Sheets.

You can now use the IMAGINARY function in Google Sheets together with the various other Google Sheets formulas available to build more complex and useful formulas for your worksheet.

Make sure to subscribe to our newsletter to be the first to know about the latest guides and tutorials from us!

Get emails from us about Google Sheets.

Our goal this year is to create lots of rich, bite-sized tutorials for Google Sheets users like you. If you liked this one, you'll love what we are working on! Readers receive ✨ early access ✨ to new content.

Leave a Reply

Your email address will not be published. Required fields are marked *

You May Also Like