Engineering function

COMPLEX function

Builds a complex number as text, such as "3+4i", from a real part and an imaginary part. Lets you choose i or j as the suffix.

Available in Excel 2007 and later (Excel 2003 needed the Analysis ToolPak add-in), Microsoft 365, Excel for the web, Excel for Mac

Excel 2007 and laterWorks in Google Sheets

Syntax

COMPLEX(real_num, i_num, [suffix])
ArgumentWhat it means
real_numRequiredThe real part of the complex number.
i_numRequiredThe imaginary part (the coefficient of i).
suffixOptional"i" (default) or "j", in lower case. Electrical engineers often use j because i means current.

Returns: Text in the form x+yi or x+yj that all the IM functions understand.

How COMPLEX works

Excel has no special data type for complex numbers. Instead it stores them as text such as 3+4i, and a family of IM functions (IMSUM, IMPRODUCT, IMABS and so on) reads and writes that text. COMPLEX is the safe way to create the text from two ordinary numbers, so you do not have to worry about signs, missing parts or formatting.

COMPLEX tidies the output the way Excel likes it: a zero imaginary part leaves just the real number (3), a zero real part leaves just the imaginary part (4i), and a coefficient of 1 or -1 is written as i or -i. Numbers are written with up to 15 significant digits.

The suffix must be exactly "i" or "j" in lower case; capital letters return #VALUE!. Keep one suffix throughout a calculation — IM functions refuse to mix i and j in the same formula.

Examples

1Combine real and imaginary parts

C2fx=COMPLEX(A2, B2)
ABC
1RealImaginary
2343+4i

Result: 3+4i

The two numbers become the text 3+4i, ready for any IM function. =IMABS(C2) would then return 5.

2Impedance with the j suffix

C2fx=COMPLEX(A2, B2, "j")
ABC
1Resistance (Ω)Reactance (Ω)
250-25.550-25.5j

Result: 50-25.5j

A 50 Ω resistor in series with a capacitor of -25.5 Ω reactance has impedance 50-25.5j. Note how Excel writes the minus sign for you.

3Pure imaginary unit

C2fx=COMPLEX(A2, B2)
ABC
1RealImaginary
20-1-i

Result: -i

With a real part of 0 and an imaginary part of -1, Excel simply writes -i.

⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 15 KB

Common errors and how to fix them

ErrorWhy it happensFix
#VALUE!real_num or i_num is non-numeric text, or suffix is anything other than "i", "j" or empty (for example "I" or "J").Use lower-case i or j and numeric parts.

Tips

  • The result is text, so =A1+B1 on two complex cells gives #VALUE!. Use IMSUM, IMSUB, IMPRODUCT and IMDIV for arithmetic.
  • Use IMREAL and IMAGINARY to split a complex number back into its parts.
  • You can type complex text directly, like "3+4i", but COMPLEX avoids typos such as 3 + 4i with spaces, which the IM functions reject.

Google Sheets

COMPLEX also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.

COMPLEX in other languages

In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.

LanguageFunction name
DanishKOMPLEKS
FinnishKOMPLEKSI
FrenchCOMPLEXE
GermanKOMPLEXE
HungarianKOMPLEX
ItalianCOMPLESSO
Norwegian (Bokmål)KOMPLEKS
PolishLICZBA.ZESP
Portuguese (Brazil)COMPLEXO
Portuguese (Portugal)COMPLEXO
RussianКОМПЛЕКСН
SpanishCOMPLEJO
SwedishKOMPLEX
TurkishKARMAŞIK