O'Reilly logo

Excel Scientific and Engineering Cookbook by David M Bourg

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

7.13. Dealing with Complex Numbers

Problem

You need to perform complex algebra (e.g., when working on electrical engineering problems involving alternating current), and would like to know how Excel supports complex numbers so you can use them in your spreadsheets.

Solution

Excel supports complex numbers in the form a + bi or a + bj (j is often used to indicate a complex number instead of i, as is common in electrical engineering applications). Further, Excel provides 18 built-in functions that can be used to manipulate complex numbers and perform complex algebra.

Tip

You need to have the Analysis ToolPak loaded in order to use Excel's complex number functions. See the introduction to Chapter 5 for instructions on loading the Analysis ToolPak.

Discussion

In Excel, a complex number is entered into a cell in the form a + bi or a + bj. In reality, Excel treats complex numbers entered this way as text. To enter a complex number, simply type it in as you would text. For example, to enter the complex number 6 + 2j, simply select a cell, type in 6+2j and then press Enter. Or you can use the COMPLEX function to let Excel format the complex number, given the real and imaginary parts you provide. For example, entering the formula =COMPLEX(6,2) in a cell results in the cell displaying the text 6+2i.

Excel provides a suite of special-purpose imaginary number functions to manipulate complex numbers in these forms. There are 18 functions that are designed to work specifically with complex numbers. All ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required