IMLN Function (LibreOffice Calc)
Learn the IMLN function in LibreOffice Calc: Returns the natural logarithm of a complex number.
Verification status: Selected examples were executed in LibreOffice Calc 25.2.3.2. This does not establish that every formula and edge case was tested. How formula examples are checked
Quick answer: what does IMLN do?
IMLN calculates the natural logarithm of a complex number, using base e (approximately 2.71828). Its input and output are represented in a+bi or a+bj complex text format. For nonzero z, the principal complex logarithm is ln(z) = ln(|z|) + i × arg(z); arg(z) determines the angle and explains the imaginary component. The original short guide correctly identified this as the natural logarithm of a complex number.
=IMLN("3+4i")
Expected mathematically and observed in native Calc 25.2.3.2: 1.6094379124341+0.927295218001612i. The real part is ln(5) because |3+4i| = 5.
Syntax and arguments
=IMLN(ComplexNumber)
ComplexNumber — Required. One complex value in text form ("3+4i", "1+j"), cell reference containing it, a value created by COMPLEX, or a real number such as 1.
There are no optional parameters or default values. An imaginary unit may be i or j. Complex strings are not ordinary numeric cells; put them in text cells or construct them using COMPLEX(real;imaginary). LibreOffice’s US-English examples use semicolons between multiargument function inputs and a period as decimal separator. A locale-customized installation can differ; use its Function Wizard rather than assuming imported Excel commas work unchanged. Official online Help was labelled 26.8 when checked on 2026-10-11. The examples here are actually run in 25.2.3.2; no unsupported claims about the introduction version are made.
Reproducible example: magnitude and angle
Enter the following in a fresh sheet:
On a narrow screen, scroll this table sideways to see every column.
| Cell | Entry | Why |
|---|---|---|
| A2 | 3+4i |
Complex text input |
| B2 | 3 |
Real coefficient |
| C2 | 4 |
Imaginary coefficient |
In D2 enter:
=IMLN(A2)
Expected / observed: 1.6094379124341+0.927295218001612i. In this example, the modulus 5 gives real part ln(5)≈1.60944; the angle atan2(4,3)≈0.927295 radians gives the imaginary part. This is a complex string, not a numeric logarithm result.
A simple real case also works:
=IMLN(1)
Expected / observed: the text 0. Native =ISTEXT(IMLN(1)) returned TRUE.
Advanced examples
If data arrive as separate numeric columns, construct the complex number first:
=IMLN(COMPLEX(B2;C2))
Expected / observed: 1.6094379124341+0.927295218001612i. This makes calculations reliable when input systems export real and imaginary components into different columns.
For a negative real input:
=IMLN(-1)
Expected / observed: 3.14159265358979i (the positive principal-branch angle at -1). This differs from ordinary real LN(-1), which cannot return a real logarithm. When comparing a phase across a branch cut, consider unwrapping the angle outside the spreadsheet.
For a reverse operation inside its principal range:
=IMLN(IMEXP("1+i"))
Expected: approximately 1+i; observed: 1+0.999999999999998i. Small floating-point differences are normal; do not compare the returned text for exact equality.
Errors, edge cases and troubleshooting
- Logarithm of zero: The mathematical complex log is undefined at zero. Native
=IMLN(0)returnedErr:502; don’t hide this withIFERRORunless the business rule specifies how zeros should be handled. - Malformed strings:
=IMLN("wrong")returnedErr:502in Calc 25.2.3.2. Confirm both coefficients and suffix if present; text labels are not accepted complex numbers. LNversusIMLN:LNis for positive real-number input and returns a numeric result.IMLNis complex-aware and returns a text-encoded complex number, including when the mathematical imaginary part is zero.- Misread imaginary part: It is an angle in radians, not degrees; values near the negative real axis change sign with the selected branch. The test for
-1establishes a specific observed boundary result, not all imaginable branch behaviour. - Imported
jvalues:=IMLN("1+j")was natively observed as0.346573590279973+0.785398163397448j. Both suffixes are valid; keep them consistent.
Cross-software compatibility and related guides
Official Microsoft Excel IMLN documentation also describes IMLN(inumber) with complex text. The equivalent function exists in Excel, but localization, displayed precision, and branch-boundary behaviour were not tested in Excel. Ordinary LN cannot substitute for complex input. Do not infer uniform support for older LibreOffice versions or mobile/web editions from this test alone.
These source paths were verified against the 2026-10-10 archive only: IMEXP, IMPOWER, IMLOG10, IMARGUMENT, COMPLEX, IMABS, and LN.
Official evidence and validation status
- LibreOffice 26.8 Help — IMLN (Add-in Analysis Functions), accessed 2026-10-11: confirms natural-log purpose, one-argument syntax and
i/jcomplex text input, plus the official rounded1+jexample. - LibreOffice analysis-functions index, accessed 2026-10-11: category scope and related complex functions.
- Microsoft Excel IMLN support, accessed 2026-10-11: Excel compatibility statement only.
- Original general Calc Help link, retained from legacy metadata.
How this guide was checked
Selected example formulas were run in LibreOffice Calc 25.2.3.2 on Linux on October 12, 2026. The official Help may cover a newer version. Tests of selected formulas do not certify every locale, interactive array operation or file round trip. View the example-check record.