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.
Need it as an auditable file?
Ships inside the linked template — formula-driven, unlocked, audit-ready.
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 tool above 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. A practical tip before you scale it up: build it once on a small block of test data, confirm the number against the tool on this page, and only then point it at your real sheet. That one habit catches almost every mistake while it is still cheap to fix, long before a wrong figure reaches a report or a colleague.
In Google Sheets
If you are in Google Sheets rather than Excel, the good news is that the formula shown here is identical and the workflow barely changes — menus sit across the top instead of in a ribbon, and a few function names differ slightly, but anything you build here moves across with little or no rework. 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. Here is the takeaway for “ln function in excel”: copy the answer if you are busy, but if you have a spare few minutes, rebuild the example in Excel yourself with the tool above open beside it. That single pass — type it, run it, watch the result move when you change an input — is what turns a formula you found into a technique you trust. Keep your inputs labelled and referenced, never hard-coded, and the same sheet stays correct and auditable as it grows. Done that way, you will not need to look this up again, and you will be the person others ask.
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.