LN Function (LibreOffice Calc)
The LN function in LibreOffice Calc returns the natural logarithm (base e) of a number. It is essential for exponential modeling, continuous compounding, and scientific calculations. Learn syntax, examples, common errors, and best practices.
Compatibility
▾| Excel | ✔ |
| Gnumeric | ✔ |
| Google_sheets | ✔ |
| Libreoffice | ✔ |
| Numbers | ✔ |
| Onlyoffice | ✔ |
| Openoffice | ✔ |
| Wps | ✔ |
| Zoho | ✔ |
What the LN Function Does ▾
- Computes the natural logarithm (base e) of a number
- Inverse of the EXP function
- Works with positive real numbers
- Useful for growth/decay modeling, finance, statistics, and scientific math
- Supports cell references, formulas, and expressions
It is designed to be precise, fast, and universally compatible.
Syntax ▾
LN(number)
Arguments
- number:
A positive real number.
Must be greater than 0.
Basic Examples ▾
Natural log of e
=LN(EXP(1))
Returns 1.
Natural log of a positive number
=LN(10)
Returns approximately 2.302585093.
LN with a cell reference
=LN(A1)
Returns the natural log of A1.
LN of a product
=LN(A1 * B1)
Equivalent to LN(A1) + LN(B1).
Advanced Examples ▾
Inverse relationship with EXP
=EXP(LN(A1))
Returns A1 (for positive values).
Continuous compound interest (solving for rate)
=LN(A2 / A1) / B1
Where:
- A1 = principal
- A2 = final amount
- B1 = time
Exponential decay model
=LN(A1 / A2) / B1
Useful in physics, chemistry, and biology.
Convert exponential form to linear form
=LN(A1)
Transforms exponential data for regression.
LN for elasticity calculations
=LN(A2 / A1) / LN(B2 / B1)
Computes elasticity using log ratios.
LN for geometric mean
=EXP(AVERAGE(LN(A1:A10)))
Computes geometric mean of a range.
LN for logistic transformations
=LN(A1 / (1 - A1))
Logit transformation for statistical modeling.
Common Errors and Fixes ▾
Err:502 — Invalid argument
Occurs when:
- number is zero
- number is negative
- number is non‑numeric
- a formula feeding LN returns an error
Fix:
Ensure the argument is a positive numeric value.
LN returns Err:503 (overflow)
Occurs when:
- number is extremely large
- intermediate calculations overflow
LN returns a negative value unexpectedly
Cause:
- LN(x) < 0 when 0 < x < 1
Example:LN(0.5)→-0.693147
This is mathematically correct.
LN returns 0 unexpectedly
Possible causes:
- number is exactly 1
- number is stored as text
- cell is empty
Fix:
Convert text to numbers using:
Data → Text to Columns → OK
Best Practices ▾
- Use LN for natural logarithms in scientific and financial models
- Use LOG for base‑10 or custom‑base logs
- Use LN with EXP for inverse transformations
- Avoid passing zero or negative numbers
- Use LN on ratios for elasticity, growth rates, and log‑linear models
Related Patterns and Alternatives ▾
- Use EXP to invert LN
- Use LOG for base‑10 or custom‑base logarithms
- Use POWER for general exponentiation
- Use A1 ^ B1 for non‑natural exponent bases
- Use LN(A2/A1) for growth rate calculations
By mastering LN and its combinations with other math functions, you can build powerful, scalable models in LibreOffice Calc that handle exponential and logarithmic relationships with precision.