IMAGINARY function
Returns the imaginary coefficient of a complex number, for example 4 from "3+4i". The result is an ordinary number.
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
IMAGINARY(inumber)| Argument | What it means | |
|---|---|---|
inumber | Required | A complex number as text such as "3+4i" or "5-2j", a cell containing one, or a plain number. Build it with COMPLEX to avoid typing errors. |
Returns: A number: the imaginary coefficient y of x+yi.
How IMAGINARY works
IMAGINARY extracts the imaginary part of a complex number stored as text: for 3+4i it returns 4, for 5-2j it returns -2. It is the partner of IMREAL, and together they let you take the text that IM functions produce and turn it back into normal numbers for charts, rounding or comparisons.
The result is a number, not text. A pure real number such as "7" has an imaginary part of 0, and a bare "i" or "-j" has an imaginary part of 1 or -1. In AC circuit work the imaginary part of an impedance is the reactance.
Examples
1Imaginary part of 3+4i
| A | B | |
|---|---|---|
| 1 | Complex | |
| 2 | 3+4i | 4 |
Result: 4
The coefficient of i is 4.
2Reactance of an impedance
| A | B | |
|---|---|---|
| 1 | Impedance (Ω) | |
| 2 | 0-j | -1 |
Result: -1
0-j has a real part of 0 and an imaginary coefficient of -1, so the reactance is -1 Ω (capacitive).
3Clean a rounding residue
| A | B | |
|---|---|---|
| 1 | Result of IMEXP | |
| 2 | -1+1.22464679914735E-16i | 0 |
Result: 0
Some IM functions leave a tiny imaginary part where the exact answer is 0. Extracting it with IMAGINARY and rounding shows that it is really 0.
Common errors and how to fix them
| Error | Why it happens | Fix |
|---|---|---|
#NUM! | The text is not a valid complex number — for example it contains spaces (3 + 4i), a capital I, or a misplaced sign. | Create the value with COMPLEX or remove spaces with SUBSTITUTE. |
Tips
- Rebuild a tidied complex number with
=COMPLEX(ROUND(IMREAL(A2),6), ROUND(IMAGINARY(A2),6)).
Google Sheets
IMAGINARY also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.
IMAGINARY 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.
| Language | Function name |
|---|---|
| Danish | IMAGINÆR |
| Dutch | C.IM.DEEL |
| Finnish | KOMPLEKSI.IMAG |
| French | COMPLEXE.IMAGINAIRE |
| German | IMAGINÄRTEIL |
| Hungarian | KÉPZETES |
| Italian | COMP.IMMAGINARIO |
| Norwegian (Bokmål) | IMAGINÆR |
| Polish | CZ.UROJ.LICZBY.ZESP |
| Portuguese (Brazil) | IMAGINÁRIO |
| Portuguese (Portugal) | IMAGINÁRIO |
| Russian | МНИМ.ЧАСТЬ |
| Spanish | IMAGINARIO |
| Swedish | IMAGINÄR |
| Turkish | SANAL |