# COMPLEX

The `COMPLEX` function returns a complex number based on real and imaginary coefficients. It is commonly used in engineering calculations and signal processing.

## Usage

Use the `COMPLEX` formula with the syntax shown below, it has 2 required parameters and 1 optional parameter:

Parameters:
1. real_part (required):
The real coefficient of the complex number.
2. imaginary_part (required):
The imaginary coefficient of the complex number.
3. suffix (optional):
An optional suffix to append to the resulting complex number, such as "i".

## Examples

Here are a few example use cases that explain how to use the `COMPLEX` formula in Google Sheets.

### Convert rectangular to polar coordinates

By using the `COMPLEX` function with real and imaginary coefficients, you can convert rectangular coordinates to polar coordinates by calculating the magnitude and phase angle of the resulting complex number.

### Perform Fourier analysis

The `COMPLEX` function is frequently used in signal processing to perform Fourier analysis on a set of data points.

### Calculate impedance

In electrical engineering, the `COMPLEX` function can be used to calculate the impedance of a circuit based on its resistance, capacitance, and inductance values.

## Common Mistakes

`COMPLEX` not working? Here are some common mistakes people make when using the `COMPLEX` Google Sheets Formula:

### Incorrect number of arguments

One of the most common mistakes when using the COMPLEX formula is to provide an incorrect number of arguments. The formula requires two required arguments (real_part and imaginary_part) and an optional suffix argument. If you forget to provide any of the required arguments or provide an extra argument, you will get an error. Make sure to provide the correct number of arguments.

### Incorrect format for arguments

Another common mistake is to provide arguments in the wrong format. The real_part and imaginary_part arguments must be numeric values or references to cells containing numeric values. The suffix argument, if provided, must be a string value. If you provide arguments in the wrong format, you will get an error. Double-check the format of your arguments.

### Incorrect order of arguments

The order of the arguments in the COMPLEX formula is important. The real_part argument must come first, followed by the imaginary_part argument, and then the optional suffix argument. If you provide the arguments in the wrong order, you will get an error. Make sure to provide the arguments in the correct order.

### Incorrect use of suffix argument

The suffix argument in the COMPLEX formula is optional and is used to specify the suffix for the imaginary part of the complex number. If you provide a suffix argument, it must be a string value that specifies one of the supported suffixes (i, j, I, or J). If you provide an incorrect suffix or use the suffix argument incorrectly, you will get an error. Make sure to use the suffix argument correctly.

### Incorrect values for arguments

Finally, it's important to provide valid values for the real_part and imaginary_part arguments. The real_part argument must be a numeric value or a reference to a cell containing a numeric value. The imaginary_part argument must also be a numeric value or a reference to a cell containing a numeric value. If you provide invalid values for these arguments, you will get an error. Double-check the values of your arguments.

The following functions are similar to `COMPLEX` or are often used with it in a formula:

• `IMAGINARY`

The `IMAGINARY` function in Google Sheets returns the imaginary coefficient of a given complex number. The imaginary coefficient is the part of the complex number that is multiplied by the imaginary unit. This function is often used in engineering and scientific applications that involve complex numbers.

You can learn more about the `COMPLEX` Google Sheets function on Google Support.