In the following image, we have shown different functions related to complex number operations in Excel. **X **and **Y **are two complex numbers. We can see the real and imaginary parts of **X **and some basic operations between these two complex numbers.

⏷Enable Complex Number Calculation

⏷Get Complex Numbers

⏷Insert Complex Numbers

⏷Find Imaginary or Real Parts of Complex Numbers

⏵Find Imaginary Part

⏵Get Real Part

⏷Basic Calculation of Complex Numbers

⏵Sum Complex Numbers

⏵Subtract Complex Numbers

⏵Multiply Complex Numbers

⏵Divide Complex Numbers

⏷Convert Complex Numbers

⏵Convert to Magnitude Form

⏵Convert to Polar Form

⏷Major Calculations with Complex Numbers

⏵Get Conjugate

⏵Find Logarithm

⏵Find Square Root

⏵Get Exponential

⏷Things to Remember

⏷Frequently Asked Questions

⏷Complex Numbers in Excel: Knowledge Hub

## What Are Complex Numbers?

Complex numbers have two parts: real and imaginary. Generally, the complex numbers are written in the **X + iY** format. **X** and **Y **are real parameters (where y aligns with the imaginary part of the number), and **i** is the solution to **i^2=-1**.

In Microsoft Excel, we can use different built-in functions like **COMPLEX**, **IMAGINARY**, and **IMREAL** to perform operations on complex numbers.

## How to Enable Complex Number Calculation in Excel

You need to activate the **Analysis ToolPak**. Without activating this add-in, you will not find functions related to complex numbers.

- Click on the
**File**tab, select**Options**and go to**Add-ins.** - Select
**Go**.

- In the
**Add-ins**window, check**Analysis ToolPak**and click**OK**.

- Go to the
**Engineering**section from the**Formulas**tab to view the complex number functions.

## How to Get Complex Numbers in Excel

The **COMPLEX **function converts real and imaginary coefficients into complex numbers. The overview of the COMPLEX function is given below.

- We will create some complex numbers from some real and imaginary coefficients.
- Select
**C****ell****D5**, insert the following formula, and press**Enter**.

`=COMPLEX(B5,C5)`

- Drag the
**Fill Handle**down to get all the complex numbers.

**Why Isn’t the COMPLEX Function Working in Excel?**

The **COMPLEX** function may not work due to various reasons, such as incorrect syntax or missing inputs:

- While writing the cell reference in the formula, make sure the cell data is in numeric format. If the values are in text or other format it won’t work.
- The
**COMPLEX**function returns a text string, so to perform further calculations, you need to use functions like**IMSUM**,**IMDIV,**and**IMABS**. - Try to use the suffix
**i**or**j**in the imaginary part of complex numbers. Use of any other letters will produce an error.

## How to Insert Complex Numbers in Excel

- To insert a complex number in Excel, you can directly type it in a cell. For example, select
**Cell D5**and type**4+5i**. You can also use the suffix “**j**” instead of “**i**“.

- You can also use the
**COMPLEX**function to insert a complex number with the suffix “j”. You need to keep the suffix inside double quotes.

*The*

**Note:****COMPLEX**function will give a

**#VALUE**error if you write the suffix in uppercase.

## How to Find Imaginary or Real Parts of Complex Numbers in Excel

### Case 1 – Find the Imaginary Part of a Complex Number

You can use **the IMAGINARY function** in Excel to find the imaginary part of a complex number.

- Select
**Cell****C5**and insert the below formula.

`=IMAGINARY(B5)`

- Press
**Enter**to get the imaginary part from**Cell B5**. - Drag down the
**Fill Handle**to find the imaginary part of the complex numbers.

### Case 2 – Get the Real Part of Complex Numbers

The **IMREAL** function extracts the real co-efficient value from a complex number.

- To extract the real part from
**Cell B5**, insert the following formula and press**Enter**.

`=IMREAL(B5)`

- Drag down the
**Fill Handle**to get the desired results.

## How to Do Basic Calculations on Complex Numbers in Excel

### Example 1 – Sum Complex Numbers

**The IMSUM function** sums the complex numbers in Excel.

- Select
**C****ell****D5**and insert the following formula.

`=IMSUM(B5,C5)`

- Press
**Enter**to sum.

- Drag the
**Fill Handle**down to add the rest of the complex numbers.

### Example 2 – Subtract Complex Numbers

You can use **the IMSUB function** in Excel to subtract complex numbers.

- To subtract
**Set 2**complex numbers from**Set 1**, apply the following formula in**Cell D5**.

`=IMSUB(C5,B5)`

- Hit
**Enter**and pull the**Fill Handle**down.

### Example 3 – Multiply Complex Numbers

You can multiply complex numbers in Excel using **the IMPRODUCT function** in Excel.

- Select
**Cell****D5**and insert the following formula.

`=IMPRODUCT(B5,C5)`

- Hit the
**Enter**key to get the product. - To find products of the other complex number, drag the
**Fill Handle**down.

### Example 4 – Divide Complex Numbers

To divide complex numbers in Excel, you need to apply **the IMDIV function**.

- Select
**Cell****D5**, insert the following formula, and press**Enter**.

`=IMDIV(C5,B5)`

**C5 **is the numerator or dividend and **B5 **is the denominator or divisor.

- Drag the
**Fill Handle**down to get the division result for the rest of the cells.

## Can We Convert Complex Numbers in Excel?

Yes, we can convert complex numbers into magnitude or polar form in Excel. Generally, we convert complex numbers into magnitude and polar form for better visualization and simplification.

### Case 1 – Convert Complex Numbers into the Magnitude Form

You can use **the IMABS function** to convert complex numbers to magnitude form.

- We have some complex numbers inside
**Column B**. We will extract the absolute value from them. - Insert the following formula in
**Cell C5**and press**Enter**.

`=IMABS(B5)`

- Use the
**Fill Handle**to fill all the cells with complex number’s magnitude.

### Case 2 – Convert Complex Numbers into the Polar Form

For converting complex numbers to polar form, you can use the combination of **IMABS** and **IMARGUMENT **functions.

- Select
**C****ell****C5**and insert the following formula.

`=IMABS(B5)&"(cos "&IMARGUMENT(B5)&" + isin "&IMARGUMENT(B5)&")"`

- Press
**Enter**to see the polar form. - Drag the
**Fill Handle**down to get the polar form of other complex numbers.

*The angles are in*

**Note:****radians**.

## What Are Some Major Calculations You Can Perform with Complex Numbers in Excel?

### Example 1 – Get the Conjugate of a Complex Number

You can use the **IMCONJUGATE** function to extract the conjugate of a complex number.

- Select
**Cell****C5**and insert the following formula.

`=IMCONJUGATE(B5)`

- Press
**Enter**and drag the**Fill Handle**down. - We will get the conjugates of the complex numbers.

### Example 2 – Find the Logarithm of a Complex Number

To get the natural logarithm of a complex number in Excel, we can use the **IMLN** function.

- Apply the following formula in
**Cell C5**.

`=IMLN(B5)`

- Hit
**Enter**and pull the**Fill****Handle**down to get the results.

### Example 3 – Find the Square Root of a Complex Number

You can use the **IMSQRT** function to get the square root from a complex number.

- Select
**C****ell****C5**and insert the following formula.

`=IMSQRT(B5)`

- Press
**Enter**. - Drag the
**Fill Handle**down to find the square root of the rest of the complex numbers.

### Example 4 – Get the Exponential of a Complex Number

To find the exponential of a complex number in Excel, you can use the **IMEXP** function.

- Select
**Cell****C5**and enter the following formula:

`=IMEXP(B5)`

- Press
**Enter**and drag the**Fill****Handle**down to get all the exponential values.

## Things to Remember

- As complex numbers have limitations in numerical accuracy, you can encounter rounding errors or loss of precision.
- While calculating complex numbers, you might face errors. You can use
**the IFERROR function**.

## Frequently Asked Questions

**Can I perform complex number exponentiation or power calculations in Excel?**

Yes, you can use the complex number’s magnitude and angle to perform exponentiation by converting the number to polar form.

**Are there any Excel functions for complex number trigonometric calculations?**

Yes, Microsoft Excel has some built-in functions for complex number trigonometric calculations. For example, **IMSIN **and **IMCOS **are used to find the sine and cosine of complex numbers respectively.

**Can I use complex numbers in conditional statements or logical operations in Excel?**

No, you can’t use complex numbers in conditional statements or logical operations. Excel’s logical functions and conditional statements are designed for real numbers. However, you can create custom logical formulas using real and imaginary components for logical operations.

**Download the Practice Workbook**

## Knowledge Hub

**<< Go Back to | Excel for Math | Learn Excel**