COMPLEX Function In Google Sheets

What Is COMPLEX Function In Google Sheets?

The COMPLEX Function in Google Sheets takes the numeric values, sorts them as the real and the imaginary parts, and converts the coefficients into a complex number in the form of “x+yi” or “x+yj”.

The Google Sheets COMPLEX function is an Engineering function, that finds its fundamental use in various fields of science and engineering, especially in electrical engineering and signal processing.

For instance, the following data consists of two numeric values. We will use the Complex function to convert the values.

COMPLEX-Function-In-Google-Sheets-Definition

Select cell C2, enter the formula =COMPLEX(A2,B2) and press “Enter”, as shown below.

COMPLEX-Function-In-Google-Sheets-Definition-1

The output is shown above. The first argument value is considered as a real number, the second argument value is considered as an imaginary number, the third argument is not provided and then we have the converted complex number.

Key Takeaways
  • COMPLEX Function in Google Sheets is an inbuilt Engineering function that helps users to convert numeric values such as Integers, decimals, etc, to complex numbers as “a+bi” or “a+bj”, where a is the real and b is the imaginary coefficients of the Complex number.
  • The suffix values of the imaginary part must always be “i” or “j”, any value or letter other than these two will not be recognized by the formula and will return an error.
  • If the suffix argument is not entered, then, by default, the formula takes the suffix as “i”.
  • Once we convert the numeric values to Complex numbers using the function, then we can use the values to perform mathematical calculations such as addition, subtraction, multiplication and division using the IMSUM(), IMSUB(), IMPRODUCT() and the IMDIV() functions in Google Sheets, respectively.

Syntax

The syntax of the COMPLEX Google Sheets Formula is,

Syntax

The arguments of the COMPLEX Google Sheets Formula are,

  1. real_part – It is the real part of the numeric value in the dataset. It is a mandatory argument.
  2. imaginary_part – It is the imaginary part of the numeric value in the dataset. It is a mandatory argument.
  3. [suffix] – It is an optional argument that is the suffix of the imaginary part after it is converted to a complex number. If it is not provided, then, by default, it is “i”.

How To Use COMPLEX Function In Google Sheets ?

We can use the COMPLEX In Google Sheets in 2 ways, namely,

  1. Access from the Google Sheets ribbon.
  2. Enter in the worksheet manually.

Method #1 – Access from the Google Sheets ribbon –

Step 1: Choose an empty cell for the output select the “Insert” tab click the “Function” option right arrow click the “Engineering” option right arrow select the “COMPLEX” function, as shown below.

Method-1

Step 2: The COMPLEX” formulaappears, as shown below. Enter the argument as cell values or cell reference.

Method-1-1

Method #2 – Enter in the worksheet manually –

Step 1: Select an empty cell for the output.

Step 2: Type = COMPLEX( in the cell, as shown below. [Alternatively, type =C or =COM and double-click the COMPLEX function from the Google Sheets suggestions.]

Method-2

Step 3: Enter the arguments as cell values in double-quotes or cell references and close the brackets.

Step 4: Press Enter to view the outcome.

Examples

Let us consider some examples to understand the COMPLEX function in Google Sheets.

Example #1 – With Suffix as cell reference

We have the data given below of the numeric values along with the suffix component. We will use the COMPLEX function to convert these values to COMPLEX numbers.

COMPLEX-Function-In-Google-Sheets-Example-1

The steps to convert the values to complex numbers using the Complex function in Google Sheets are,

Step 1: Select cell D2. Enter the formula =COMPLEX(A2,B2,C2), as shown below.

Example-1-Step-1

Step 2: Press “Enter” to get complex number. It is as shown below.

Example-1-Step-2

Step 3: Drag the formula from cell D2 to D5 using the fill handle, to get the output shown below.

Example-1-Step-3

Example #2 – Different value scenarios

Consider the dataset given below that consists of different scenarios such as both the values are decimals, or one is a decimal and the other is not, we have one of the values as 0 or blank. We will use the COMPLEX function to convert these different value combinations to complex numbers.

COMPLEX-Function-In-Google-Sheets-Example-2

The steps to convert the values to complex numbers using the Google Sheets Complex function are,

Step 1: Select cell C2, enter the formula =COMPLEX(A2,B2,C2) and press “Enter”, as shown below.

Example-2-Step-1

Step 2: Drag the formula from cell C2 to C8 using the fill handle, to get the output shown below.

Example-2-Step-2

Output Observation:

  1. We see that wherever both the values are provided, regardless of the numeric value, whether a decimal or an integer, we get the converted complex numbers.
  2. However, when there is a 0 or blank, then, that numeric part, whether real or imaginary, is ignored. The other number is converted to the complex number. For example, cell A7 is blank, i.e. the real part of the number is not given but the imaginary part, i.e. 300, is provided. Therefore, the converted complex number is 300i in cell C7.

Example #3 – #Value! error.

Consider the dataset given below that consists of different scenarios that where we use the suffix components that are not compatible with the formula. We will use the COMPLEX function to convert these different value combinations to complex numbers.

COMPLEX-Function-In-Google-Sheets-Example-3

The steps to convert the values to complex numbers using the Google Sheets Complex function are,

Step 1: Select cell D2, enter the formula =COMPLEX(A2,B2,C2) and press “Enter”, as shown below.

Example-3-Step-1

Step 2: Drag the formula from cell D2 to D7 using the fill handle, to get the output shown below.

Example-3-Step-2

Output Observation: We get the “#VALUE” error due to the following reasons.

  1. Rows 2 & 5 – If one of the values is non-numeric, then. we get an error.
  2. Rows 4, 6 & 7 – The suffix component must always be the letters “i” or “j”. Any other value in its place, will give an error. If no value is provided, then, by default, it will be assumed as “i”.

Example #4 – Basic Arithmetic operations

We have two complex values given below. Google Sheets allows to perform Basic Arithmetic operations on complex numbers.

COMPLEX-Function-In-Google-Sheets-Example-4

The steps to perform Basic Arithmetic operations on complex numbers are as follows:

Step 1: Select cell A5, enter the formula =IMSUM(A2,B2). Press “Enter”, to get the addition results of the complex numbers, as shown below.

Example-4-Step-1

Step 2: Select cell C5, enter the formula =IMSUB(A2,B2). Press “Enter”, to get the difference between the complex numbers, as shown below.

Example-4-Step-2

Step 3: Select cell A8, enter the formula =IMPRODUCT(A2,B2). Press “Enter” to get the product of the complex numbers, as shown below.

Example-4-Step-3

Step 4: Select cell C8, enter the formula =IMDIV(A2,B2) . Press “Enter” to get the division of the complex numbers, as shown below.

Example-4-Step-4

Important Things To Note

  1. The values must always be numbers. Empty or blank cells, cells with 0 as value, or non-numeric cells always return #VALUE! error.
  2. Ensure to organize the data in a right manner, so we know which value must be the real and the imaginary coefficients for the complex numbers.
  3. We can enter the suffix argument in multiple ways, namely,
    • First, by not inserting it in the formula and the formula returns the result with the default value “i”.
    • Second, by inserting it as a cell reference.
    • Third, by inserting it as a cell value, but always within double-quotes.

Frequently Asked Questions (FAQS)

1. What is an alternate way to insert the COMPLEX Google Sheets function?

We often forget in which category a function falls, here, the “COMPLEX” function. Then, we can insert the function as follows:
Choose an empty cell – select the “Insert” tab – click the “Function” option right arrow – click the “All” option right arrow – select the “COMPLEX” function, as shown below.
FAQ-1
However, as always, entering the function manually is the best way to avoid confusion.

2. Where else can we find the COMPLEX function in Google Sheets?

Alternatively, we can find the Functions icon to insert the COMPLEX function in Google Sheets by following the path shown below.
Choose an empty cell – click the “More” option represented by the three vertical dots at the end of the toolbar, as shown below.
FAQ-2
A list of icons appears when we click the “More” option. Here, click the “Functions” icon, as shown below.
FAQ-2-1
Here, click the “Functions” option – click the “All” option right arrow – select the “COMPLEX” function, as shown below.
FAQ-2-2

3. Why is the COMPLEX function in Google Sheets not working?

The COMPLEX in Google Sheets will give an error for the following reasons;
• If the suffix is entered as a value and not entered within double-quotes.
• If one of the values is an empty or a blank cell, is 0, is non-numeric, etc.

Download Template

This article must help understand the COMPLEX function in Google Sheets with its formula and examples. You can download the template here to use it instantly.

Recommended Articles

Guide to What Is COMPLEX Function In Google Sheets. We learn its syntax and how to use it to convert values to complex numbers with examples. You can learn more from the following articles. –

SUMIF Greater Than In Google Sheets

Add Time In Google Sheets

Bullet Points In Google Sheets

Reader Interactions

Leave a Reply

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