IMLN function
Returns the natural logarithm of a complex number, ln|z| + i·arg(z). Also works for negative real numbers.
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
IMLN(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 complex number as text.
How IMLN works
IMLN returns the natural logarithm of a complex number: the real part is the ordinary log of its size and the imaginary part is its angle in radians. In symbols, ln(z) = ln|z| + i·arg(z). That means it can take the log of a negative number — something LN refuses to do — because -1 is simply a number pointing at angle π.
Excel returns the principal logarithm, with an imaginary part between -π and π. Zero has no logarithm and returns #NUM!. Like all IM functions, it reads complex numbers written as text (x+yi or x+yj) and returns its answer as text with up to 15 significant digits, so you can feed the result straight into another IM function.
Examples
1Natural log of 3+4i
| A | B | |
|---|---|---|
| 1 | Complex | |
| 2 | 3+4i | 1.6094379124341+0.927295218001612i |
Result: 1.6094379124341+0.927295218001612i
|3+4i| = 5 and ln 5 = 1.6094…; the angle is 0.9273 radians. Together: 1.6094379124341+0.927295218001612i.
2Log of a negative number
| A | B | |
|---|---|---|
| 1 | Value | |
| 2 | -1 | 3.14159265358979i |
Result: 3.14159265358979i
-1 has size 1 (ln 1 = 0) and angle π, so the result is πi. =LN(-1) would return #NUM!.
Common errors and how to fix them
| Error | Why it happens | Fix |
|---|---|---|
#NUM! | The input is 0 or not a valid complex number. | Check that the value is not zero. |
#VALUE! | The argument is a logical value, or the formula mixes the i and j suffixes. | Use one suffix consistently throughout a calculation. |
Tips
Google Sheets
IMLN also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.
IMLN 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 | IMAGLN |
| Dutch | C.LN |
| Finnish | KOMPLEKSI.LN |
| French | COMPLEXE.LN |
| Hungarian | KÉPZ.LN |
| Italian | COMP.LN |
| Polish | LN.LICZBY.ZESP |
| Russian | МНИМ.LN |
| Spanish | IM.LN |
| Turkish | SANLN |