Contact

LN Function (OpenOffice Calc)

Math Intermediate OpenOffice Calc OpenOffice.org 3.0

The LN function in OpenOffice Calc returns the natural logarithm of a number. Learn syntax, domain rules, examples, and best practices.

Verification status: Consult the documentation and examples below. Native application testing has not been documented for this guide. How formula examples are checked

The LN function in OpenOffice Calc returns the natural logarithm of a number — the logarithm with base e (approximately 2.718281828…). LN is essential for continuous growth modeling, exponential decay, probability distributions, and scientific and engineering calculations.

What the LN Function Does

  • Computes the natural logarithm ( \ln(x) )
  • Only accepts positive numbers
  • Useful for continuous growth, decay, and probability models
  • Inverse of the EXP function
  • Works across sheets

LN is ideal when you need logarithmic scaling or want to reverse exponential transformations.

Syntax

LN(number)

Arguments:

  • number — A positive numeric value
LN is undefined for zero and negative numbers.

Domain Rules

Input LN Result
Positive number Valid
0 Error
Negative number Error
Text Error

Mathematically:

[ \ln(x) \text{ is defined only for } x > 0 ]

Basic Examples

Natural logarithm of a number

=LN(10)

LN of e (≈ 2.718281828)

=LN(EXP(1))

Result: 1

LN of a product

=LN(A1 * B1)

LN using a cell reference

=LN(A1)

Advanced Examples

Reverse an exponential transformation

=LN(EXP(A1))

Always returns A1.

Convert discrete rate to continuous rate

=LN(1 + r)

Example:

=LN(1.05)

Convert continuous rate to discrete rate

=EXP(r) - 1

Continuous compound interest (solving for rate)

Given:

[ A = P e^{rt} ]

Solve for r:

=LN(A / P) / t

Exponential decay constant

=-LN(remaining_fraction) / time

LN across sheets

=LN(Sheet1.A1)

LN for probability distributions

Normal distribution exponent core:

=-LN(SQRT(2 * PI()) * sd) - POWER(x - mean; 2) / (2 * POWER(sd; 2))

LN in array formulas

=LN(A1:A10)

Confirm with Ctrl+Shift+Enter.

Common Errors and Fixes

LN returns Err:502 (Invalid argument)

Occurs when:

  • Input ≤ 0
  • Input is text
  • Input is empty
  • A malformed reference is used

LN returns Err:503 (Numeric overflow)

Occurs when:

  • Input is extremely large
  • Result exceeds Calc’s numeric limits

LN returns unexpected results

Possible causes:

  • Using LN on percentages without converting (e.g., 5% vs 0.05)
  • Negative or zero values from formulas
  • Text numbers not converted to numeric

LN ignores values you expected it to include

LN ignores:

  • Text numbers ("123")
  • Empty cells
  • Logical values
  • Errors

LN includes values you expected it to ignore

LN includes:

  • Dates
  • Times
  • Numeric results of formulas

Err:508 — Missing parenthesis

Usually caused by:

  • Missing )
  • Using commas instead of semicolons

Best Practices

  • Use LN for continuous‑rate math
  • Use EXP to reverse LN transformations
  • Validate inputs to avoid negative or zero values
  • Convert imported text numbers to real numbers
  • Use named ranges for cleaner formulas
  • Use LN for probability, statistics, and scientific modeling
LN + EXP is one of the most powerful mathematical pairs in Calc — they let you move seamlessly between exponential and logarithmic worlds.