How to Insert, Use and Convert Complex Numbers in Excel?

In this Excel tutorial, you will learn how to
– Insert complex numbers in Excel
– Find imaginary and real parts of a complex number
– Sum, subtract, multiply, and divide complex numbers in Excel
– Convert complex numbers to the magnitude and polar form

We used Microsoft 365 to prepare this article. You can apply the mentioned functions in versions from Excel 2007 onwards.

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

Complex numbers in Excel

Click on the image to see the detailed view


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 x+iy format. Here, i stands for √(-1), x is the real part and y is the imaginary part.

We use these numbers in various engineering, scientific, and mathematical applications. In Microsoft Excel, we can use different built-in functions like COMPLEX, IMAGINARY, and IMREAL to perform the operations.


How to Enable Complex Number Calculation in Excel?

In order to enable complex number calculation, you need to activate the Analysis Toolpak. Without activating this add-in, you will not find functions related to complex numbers.

  • To activate the Analysis ToolPak, click on the File tab >> select Options >> Add-ins >> Go.

Steps to activate Analysis ToolPak

  • Now from the Add-ins window, check Analysis ToolPak >> click OK.

Enabling complex number functions by visiting Excel Add-ins

  • Finally, visit the Engineering section from the Formulas tab to view the complex number functions.

Choosing Complex option from the Formulas tab


How to Get Complex Numbers in Excel?

We can use the COMPLEX function 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.

Overview of COMPLEX function

  • We will create some complex numbers from some real and imaginary coefficients.
  • Select Cell D5, write the below formula, and press Enter.
=COMPLEX(B5,C5)
  • Drag the Fill Handle down to get all the complex numbers.

Getting complex number using COMPLEX function


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. Below I have shared some possible reasons with solutions regarding this issue.

  • 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 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“.

Inserting complex numbers in Excel

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

Inserting complex number with suffix j

Note: The 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?

To find the imaginary and real parts of complex numbers in Excel, we need to use the IMAGINARY and IMREAL functions.

In mathematical calculations, we often need to use imaginary or real parts of a complex number separately. In those cases, we can use these two functions to get the result quickly.


1. Find Imaginary Part of a Complex Number

You can use the IMAGINARY function in Excel to find the imaginary part of a complex number. From the below dataset, we will extract the imaginary part from a complex number.

  • Select Cell C5 and write the below formula.
=IMAGINARY(B5)
  • Press Enter to get the imaginary part from Cell B5.
  • Then, drag down the Fill Handle to find the imaginary part of the complex numbers.

Finding imaginary part using the IMAGINARY function


2. Get Real Part of Complex Numbers

To get the real part of a complex number in Excel, you can use the IMREAL function. The IMREAL function extracts the real co-efficient value from a complex number.

  • To extract the real part from Cell B5, type the following formula and press Enter.
=IMREAL(B5)
  • Next, drag down the Fill Handle to get the desired results.

Finding the real part using the IMREAL function


How to Do Basic Calculation of Complex Numbers in Excel?

Using the IMSUM, IMSUB, IMPRODUCT, and IMDIV functions, you can do basic calculations like- sum, subtract, multiply, and divide complex numbers in Excel.


1. Sum Complex Numbers

The IMSUM function sums the complex numbers in Excel. Here, we will sum up some complex numbers from multiple cells.

  • Select Cell D5 and type the below formula.
=IMSUM(B5,C5)
  • Press Enter to sum.
  • Drag the Fill Handle down to add the rest of the complex numbers.

Using IMSUM Function to Sum Complex Numbers in Excel


2. Subtract Complex Numbers

You can use the IMSUB function in Excel to subtract complex numbers. The IMSUB function returns the difference between two complex numbers. In this section, we will subtract complex numbers between two columns.

  • To subtract Set-2 complex numbers from Set-1, apply the following formula in Cell D5.
=IMSUB(C5,B5)
  • After that, pull the Fill Handle down.

Applying IMSUB Function to Subtract Complex Numbers in Excel


3. Multiply Complex Numbers

You can multiply complex numbers in Excel using the IMPRODUCT function in Excel. The IMPRODUCT function gives you the product of two or more complex numbers. Here, we will multiply between two sets of complex numbers.

  • Select Cell D5, and type the below formula.
=IMPRODUCT(B5,C5)
  • Hit the Enter key to get the product.
  • To find products of the other complex number, just drag the Fill Handle down.

Using IMPRODUCT Function to Multiply Complex Numbers in Excel


4. Divide Complex Numbers

To divide complex numbers in Excel, you need to apply the IMDIV function. The IMDIV function divides two complex numbers and returns the quotient. Here, we will divide complex numbers between two columns.

  • Select Cell D5, type the following formula, and press Enter.
=IMDIV(C5,B5)
  • Here, 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.

Applying IMDIV Function to Divide Complex Numbers in Excel


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.

Sometimes, you may need to plot complex numbers in the Cartesian (x,y) and Polar (r,θ) coordinate systems. We can use the following two methods for the conversion.


1. Convert Complex Numbers Into Magnitude Form

You can use the IMABS function to convert complex numbers to magnitude form. The IMABS function extracts the absolute value of a complex number.

  • In this part, we have some complex numbers inside Column B. We will extract the absolute value from them.
  • Write the below formula in Cell C5 and press Enter.
=IMABS(B5)
  • Use the Fill Handle to fill all the cells with complex number’s magnitude.

Converting to magnitude form using the IMABS function


2. Convert Complex Numbers Into Polar Form

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

Here, the IMARGUMENT function will determine the angle of a complex number and the IMABS function will generate the magnitude of the complex number.

  • Select Cell C5, and type 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.

Combining the IMABS and IMARGUMENT function convert complex numbers to polar form

Note: The angles are in radians.

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

Calculating the conjugate, logarithm, square root, and exponential of complex numbers are some of the major calculations in Excel. In the following, let’s get to know about those in detail.


1. Get the Conjugate of a Complex Number

You can use the IMCONJUGATE function to extract the conjugate of a complex number. The conjugate of a complex number is the same number with the opposite sign of its imaginary part. It is essential for various calculations, as it helps us to find the magnitude of complex equations.

  • First, select Cell C5, and write the following formula.
=IMCONJUGATE(B5)
  • Then, press ENTER and drag the Fill Handle down.
  • As a result, we will get the conjugate of the complex numbers.

Formula of IMCONJUGATE function to get conjugate of complex number


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. We apply the logarithm of a complex number in fields like physics, engineering, and finance to analyze exponential growth.

  • Write the below formula in Cell C5.
=IMLN(B5)
  • Next, click ENTER and pull the Fill Handle down to get the results.

Formula of IMLN function to get logarithm of complex number


3. Find the Square Root of a Complex Number

You can use the IMSQRT function to get the square root from a complex number. The square root of a complex number is essential in solving certain equations. These equations involve physical quantities like electrical impedance, wave amplitudes, and quantum states.

  • Select Cell C5, and type the below formula.
=IMSQRT(B5)
  • Press ENTER.
  • Drag the Fill Handle down to find the square root of the rest of the complex numbers.

Formula of IMSQRT function to get square root of complex number


4. Get the Exponential of a Complex Number

To find the exponential of a complex number in Excel, you can use the IMEXP function. The exponential of a complex number involves calculating the value of ‘e‘ raised to the power of the given complex number. This operation is fundamental in solving differential equations like modeling complex systems.

  • Select Cell C5, and write the below formula.
=IMEXP(B5)
  • After that, press ENTER and drag the Fill Handle down to get all the exponential values.

Formula of IMEXP function to get exponential of complex number


Which Things Should You Remember?

  • As complex numbers have limitations in numerical accuracy, you must be mindful of potential rounding errors or loss of precision.
  • While calculating complex numbers, you might face errors. To handle errors gracefully, you can use the IFERROR function.

Frequently Asked Questions

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

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

2. Are there any Excel functions for complex number trigonometric calculations?

Answer: 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.

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

Answer: 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 Practice Workbook


Conclusion

In conclusion, we can say that for adding, subtracting, multiplying, and dividing complex numbers, Excel’s built-in functions play a vital role. In order to save time and solve critical problems with complex numbers, you can use these functions. For better visualization, you can convert complex numbers to magnitude and polar form too. Please inform us in the comment section about your experience.


Knowledge Hub


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

Get FREE Advanced Excel Exercises with Solutions!
Wasim Akram
Wasim Akram

Wasim Akram holds a BSc degree in Industrial and Production Engineering from Ahsanullah University of Science and Technology. Over the past 2 years, he has been actively contributing to the ExcelDemy project, where he has authored more than 150 articles. Now, he is working as an Excel VBA and Content Developer. He likes learning new things about Microsoft Office, especially Excel VBA, Power Query, Data Analysis, and Excel Statistics. He is also very interested in machine learning and... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo