LN
Return the natural logarithm (base e) of a positive number. The inverse of EXP.
Syntax
LN(number) | Argument | Required | Description |
|---|---|---|
number | Required | A positive number. |
Examples
Every example below was executed against VisiGrid engine 0.54.0 — not
transcribed from another vendor's documentation. Reproduce any of them with vgrid calc.
| Formula | Result | Notes |
|---|---|---|
=LN(1) | 0 | |
=LN(EXP(2)) | 2 | LN undoes EXP. |
=LN(10) | 2.30 | |
=LN(B2/A2) | 0.80 | The log return from 9 to 20. |
=LN(0) | #NUM! | Zero and negative numbers have no logarithm. |
LN, LOG and LOG10
Three functions, three bases. LN is base e. LOG10 is
base 10. LOG defaults to base 10 and takes any base as a
second argument. Programmers should note that log() in most languages is the
natural log — here that is LN, and LOG is base 10.
Doubling time
How many years something growing at 7% takes to double:
=LN(2)/LN(1.07) → 10.24
The same pattern answers any “how long until it reaches X” question — divide the log of the target multiple by the log of the growth factor.
Log returns
LN(end/start) is the continuously compounded return between two prices. Unlike
simple percentage returns, log returns over consecutive periods add up, so a
SUM of them is the return over the whole span.
Excel compatibility
Matches Excel, including #NUM! for zero and negative input.