## How to use the IMLN function

The IMLN function calculates the natural logarithm of a complex number in x + yi or x + yj text format.

The letter j is used in electrical engineering to distinguish between the imaginary value and the electric current.

**What is a natural logarithm?**

A natural logarithm is a logarithm with the base e, which is an irrational number approximately 2.7182818284591

Ln is the inverse of the natural exponential function e.

x = e^{ln x}Â or x = ln e^{x}

x + yi= e^{ln x+yi} or x + yi = ln e^{x+yi}

**What is an irrational number?**

It is a number that can't be expressed as a simple fraction, in other words, the number of decimals are infinite. Other examples of irrational numbers are âˆš2 and Ï€.

### Table of Contents

## 1. IMLN Function Syntax

IMLN(*inumber*)

## 2. IMLN Function Arguments

inumber |
Required. A complex number in x+yi or x+yj text format. |

## 3. IMLN function example

The image above demonstrates a formula in cell B28 that calculates the natural logarithm of a complex number specified in cell B25.

Formula in cell B28:

The chart above demonstrates the complex plane, the y-axis the the imaginary axis and the x-axis is the real axis.

Complex number 2+2i is the light blue line in the first quadrant. The natural logarithm of 2+2i is the green line also in the first quadrant.

### 3.1 Explaining formula

#### Step 1 - Populate arguments

IMLN(*inumber*)

becomes

IMLN(B25)

#### Step 2 - Evaluate the IMLN function

IMLN(B25)

becomes

IMLN("2+2i")

and returns

1.03972077083992+0.785398163397448i

## 4. How is the IMLN function calculated in detail?

The natural logarithm of a complex number is calculated like this:

C = x + yi

IMLN(C) =lnâˆš(x^{2}+y^{2})+ itan^{-1}(y/x)

For example,

C=2+2i

IMLN(C) =lnâˆš(2^{2}+2^{2})+ itan^{-1}(2/2)

IMLN(C) =lnâˆš8+ 0.785398163397448i

IMLN(C) =1.03972077083992+ 0.785398163397448i

## 5. The IMLN function not working - #NUM error?

IMLN(0) (zero) is not possible because the natural logarithm function ln(x+yi) is defined only for x<>0. The IMLN function returns #NUM error if the argument is 0 (zero).

The IFERROR function lets you catch errors, it can return a value you specify if an error value is returned.

## 6. How to enter negative complex numbers in Excel

Excel shows a dialog box if you try to enter a negative complex number in a cell. It thinks a typo was made and tries to correct the input, however, the corrected string is wrong.

Press with left mouse button on the "No" button, another dialog box appears.

This dialog box is actually helpful, Excel thinks t's a formula when the first character is an equal sign or a minus sign. A workaround is to type an apostrophe ' first and then the string.

Press the "OK" button to dismiss the dialog box.

Now type the apostrophe and then the negative complex number. This works and Excel thinks the input string isÂ a text string.

Another way to enter negative complex numbers is to use the COMPLEX function. It returns a complex number based on a real and imaginary value.

### Useful links

IMLN function - Microsoft

Complex logarithm

The Logarithmic Function

### Functions in 'Engineering' category

The IMLN function is one of many functions in the 'Engineering' category.

## How to comment

How to add a formula to your comment<code>Insert your formula here.</code>

Convert less than and larger than signsUse html character entities instead of less than and larger than signs.

< becomes < and > becomes >

How to add VBA code to your comment[vb 1="vbnet" language=","]

Put your VBA code here.

[/vb]

How to add a picture to your comment:Upload picture to postimage.org or imgur

Paste image link to your comment.

Contact OscarYou can contact me through this contact form