Electrical engineers work with impedance. Signal analysts work with phasors. Physicists work with wave functions. All of them need complex numbers, the kind written as a real part plus an imaginary part like 3+4i. Ordinary Excel arithmetic cannot handle these directly, because Excel stores a complex number as text. Instead, Excel gives you a whole family of engineering functions that begin with IM. The starting point is IMSUM, which adds complex numbers, alongside COMPLEX to build them and IMREAL and IMAGINARY to read them back.
This guide explains how Excel handles complex numbers from the ground up. First, it shows how they are stored and built. Then it covers the core arithmetic functions and how to read results back. Seven worked examples and a full troubleshooting section follow. By the end, you will manipulate complex numbers in any spreadsheet with real confidence.
How Excel Stores Complex Numbers
A complex number has two parts. The real part is an ordinary number. The imaginary part is a multiple of i, the square root of minus one. Excel keeps both together as a single text string like 3+4i. The infographic below shows how they add like vectors on a plane.
Because the value is text, you cannot simply add two cells with a plus sign. That would fail or give nonsense. Instead, you use IMSUM and its relatives. Consequently, a dedicated function family exists for every operation. Each function reads the text, does the maths, and writes clean text back. This design keeps the complex parts in step automatically.
Building and Reading Complex Numbers
Two functions bridge normal numbers and complex ones. COMPLEX builds a complex number from a real and an imaginary part. IMREAL and IMAGINARY pull those parts back out. Together they form the entry and exit points. You will almost always start and end a calculation with these.
The Core Arithmetic Functions
Excel mirrors each basic operation with an IM function. Addition, subtraction, multiplication, and division all have one. Each takes complex text strings and returns a complex text string. The names are easy to remember, since they simply prefix IM. This consistency makes the family quick to learn.
Example 1: Add Two Complex Numbers
To begin, start with the core task at hand. You add two complex numbers with IMSUM. It combines the real parts and the imaginary parts separately. The result comes back as a text string. This is the most common complex operation of all.
Example 2: Subtract and Multiply
Subtraction and multiplication follow the same style. IMSUB takes the difference of two numbers. IMPRODUCT multiplies, which mixes the parts in a less obvious way. Both return complex text strings. The rules are handled for you internally.
Example 3: The Magnitude with IMABS
A complex number has a size, called its magnitude. IMABS returns it in one step. Geometrically, it is the distance from the origin to the point. This is vital in engineering, where it represents amplitude or impedance size.
Example 4: The Angle with IMARGUMENT
A complex number also has a direction, called its argument. IMARGUMENT returns that angle in radians. Together, the magnitude and angle give the polar form. Engineers use this polar view constantly, especially for phase in AC signals.
Example 5: An AC Impedance Calculation
Here is a real engineering use. Two impedances in series simply add. Each impedance is a complex number, with resistance as the real part and reactance as the imaginary part. IMSUM combines them, and IMABS gives the total magnitude. This is everyday work in circuit design.
Example 6: The Complex Conjugate
The conjugate flips the sign of the imaginary part. IMCONJUGATE returns it directly. This appears in division and in power calculations. It is a small but frequent operation in complex algebra.
Example 7: Build a Complex Calculation Table
A table keeps a set of results organised. You list your complex inputs down a column. Then you apply IM functions across the columns beside them. This is a clean way to document engineering work. It also makes each step easy to check.
The real and imaginary columns use IMREAL and IMAGINARY. The magnitude column uses IMABS. Together they turn opaque text strings into readable engineering data. You can then chart or sort the numeric columns as usual. This bridges the complex world and normal spreadsheet analysis.
Troubleshooting Complex Number Functions
All three problems below are the most common. Each has a clear cause and a quick fix.
You get a #NUM! error
This error usually means a complex value is badly formatted. Excel is strict about the text format it accepts, so "3 + 4i" with spaces will fail, while "3+4i" works. The imaginary unit must be a lowercase i or j, and the two functions in a formula should use the same unit throughout. Mixing i and j in one calculation causes an error. Check that every complex string follows the tight format with no spaces and a consistent unit. Once the strings are clean, the functions calculate as expected.
Regular addition gives the wrong answer
If adding complex cells with a plus sign gives a strange result, remember that these values are text, not numbers. A plus sign either concatenates them or throws an error, because Excel cannot do arithmetic on complex text directly. You must use IMSUM instead of the plus operator, and the matching IM function for every other operation. This is the single most common mistake with complex numbers in Excel. Replace ordinary operators with their IM equivalents, and the calculations will behave correctly.
IMREAL or IMAGINARY returns an error
If extracting a part fails, the input may not be a valid complex string, or it may be a pure number. A plain "5" is treated as the complex number five plus zero i, so IMREAL returns 5 and IMAGINARY returns 0, which is correct. However, a value like "4i" alone must be written properly, and a malformed string will error. Confirm the cell holds a valid complex text value in the exact format Excel expects. Rebuilding it with COMPLEX guarantees a clean, readable input.
Frequently Asked Questions
- What does the IMSUM function do?+Essentially, IMSUM adds two or more complex numbers together and returns the result as a complex text string. It combines the real parts and the imaginary parts separately, just as you would add vectors. For example, =IMSUM("3+4i", "1+2i") returns "4+6i", because 3 plus 1 is 4 and 4 plus 2 is 6. You can pass many arguments, not just two, which makes it convenient for summing a list of complex values such as several impedances in series. Because complex numbers are stored as text, you cannot use the ordinary plus operator, so IMSUM is the correct tool for addition.
- Why can I not add complex numbers with a plus sign?+Specifically, Excel stores a complex number like "3+4i" as a text string, not as a numeric value, so ordinary arithmetic operators do not work on it. Using a plus sign would attempt to join or add text, giving an error or nonsense rather than a proper complex sum. Because of this, Excel provides a full family of engineering functions beginning with IM, such as IMSUM for addition, IMSUB for subtraction, IMPRODUCT for multiplication, and IMDIV for division. Each accepts complex text strings and returns a complex text string. Whenever you calculate with complex numbers, you must use these IM functions rather than the standard operators.
- How do I get the magnitude and angle of a complex number?+Notably, IMABS returns the magnitude and IMARGUMENT returns the angle, which together give the polar form. The magnitude is the distance from the origin to the point on the complex plane, so =IMABS("3+4i") returns 5, since that equals the square root of 3 squared plus 4 squared. The argument is the direction, measured in radians, so =IMARGUMENT("3+4i") returns about 0.9273, which you can convert to degrees with the DEGREES function. In engineering, the magnitude represents an amplitude or impedance size, while the angle represents a phase, making these two functions central to AC circuit and signal analysis.
- Can I use j instead of i for the imaginary unit?+Because electrical engineers traditionally use j to avoid confusion with current, Excel supports both i and j as the imaginary unit. When building a complex number with COMPLEX, you can specify the suffix, so =COMPLEX(3, 4, "j") returns "3+4j". The key rule is consistency: every complex value in a single calculation must use the same unit, and mixing i and j within one formula produces an error. The default suffix is the lowercase i, but if your field prefers j, simply use it throughout. Both are equally valid, so choose the convention that matches your discipline and apply it uniformly.