In Excel: use =LN(number) — it returns the natural logarithm (base e), so =LN(2.718281828) returns 1 and =LN(1) returns 0.
On this page8
Syntax
Arguments
| Argument | required / optional | Description |
|---|---|---|
number | required | A positive value. Zero or negative returns #NUM!. |
Related functions
Click the result cell and type =LN(.
Select the positive value or the ratio, such as A3/A2.
Press Enter.
To return to the original scale, wrap the result in EXP.
What this does
LN returns the logarithm of a number to base e, and is the inverse of EXP. Its practical role in a spreadsheet is turning multiplicative relationships into additive ones: log returns are additive across periods where percentage returns are not, which is why finance work often converts a price series with LN before analysing it. It also linearises exponential data so a straight-line trend can be fitted. Only strictly positive inputs are valid — zero and negatives return #NUM!. Keep the inputs visible and clearly labelled and the whole thing stays auditable — anyone who opens the file later, including you, can see at a glance exactly what feeds the result and change one assumption without hunting through the formula. The difference between a quick fix and a sheet you can trust is the extra minute you spend validating “ln function in excel”. Start on a copy or a tiny sample, keep the affected formula visible, and compare the result with the outcome you expected before you touch the real workbook. When a formula is involved, keep the inputs labelled beside it, reference cells instead of typing values, and apply number formatting only after the result checks out. The point is a calculation you can defend to a CFO or an auditor, but the practical win is that someone else can open the file and understand what happened without asking you.
A worked example
A continuously compounded return between prices in A2 and A3: =LN(A3/A2). Working out the time for a value to double at 7 % continuous growth: =LN(2)/0.07 returns about 9.9 periods. Linearising an exponential series before charting a trend: =LN(B2) filled down the column. LN turns compounding into addition, which is what makes multi-period returns and exponential trends tractable in a spreadsheet at all. Check the referenced cells, argument order and result type in your workbook. Start with the worked example before changing an input, then compare the changed result with the calculation you expected. An error value or a result of a different type is a reason to inspect the inputs and arguments.
In Google Sheets
Google Sheets support for this task has not been verified. Check the function, arguments and workflow in the target product before transferring the example. Matching formula notation does not establish identical behaviour. Keep this page bookmarked for the next time the same question comes up. Better still, repeat the steps once in your own workbook — doing it yourself is what turns a copied answer into something you remember. For “ln function in excel”, keep the input cells and the result visible while you check the formula in Excel. Follow the worked example and change one input at a time. The steps explain the workbook calculation; this page does not run a live calculator for that task.
Common mistakes
- Passing zero or a negative number, which returns
#NUM!— a log of a non-positive value is undefined. - Confusing
LNwith LOG: LOG defaults to base 10,LNis always base e. - Adding percentage returns as if they were log returns; only log returns sum across periods.
Frequently asked questions
What is the difference between LN and LOG?
LN is fixed to base e. LOG defaults to base 10 and accepts any base as an optional second argument. =LOG(A2, EXP(1)) is the same as =LN(A2).
Why does LN return #NUM!?
The input is zero or negative. Logarithms are only defined for positive numbers.
How do I get back to the original number?
Apply EXP: =EXP(LN(A2)) returns A2.