Engineering function

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)
ArgumentWhat it means
inumberRequiredA 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

B2fx=IMLN(A2)
AB
1Complex
23+4i1.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

B2fx=IMLN(A2)
AB
1Value
2-13.14159265358979i

Result: 3.14159265358979i

-1 has size 1 (ln 1 = 0) and angle π, so the result is πi. =LN(-1) would return #NUM!.

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

Common errors and how to fix them

ErrorWhy it happensFix
#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

  • IMLOG10 and IMLOG2 give logs in other bases; ln(z)/ln(b) gives any base: =IMDIV(IMLN(z), LN(b)).

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.

LanguageFunction name
DanishIMAGLN
DutchC.LN
FinnishKOMPLEKSI.LN
FrenchCOMPLEXE.LN
HungarianKÉPZ.LN
ItalianCOMP.LN
PolishLN.LICZBY.ZESP
RussianМНИМ.LN
SpanishIM.LN
TurkishSANLN