Contact

LN Function (OpenOffice Calc)

Math Intermediate OpenOffice Calc Introduction not established

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, examples and any stated test scope below. How formula examples are checked

Availability and version history

  • Introduced: Documented by Apache OpenOffice 4.1.16; original introduction not established.
  • Availability: Supported in Apache OpenOffice 4.1.16, verified against its function registry. This identifies a supported release, not a final working version.
  • Scope: Desktop Calc, using the English function name. Availability in other spreadsheet applications is separate.
  • Checked: 2026-10-14 — function reference; versioned support. Documentation/source check; not a new native test. Existing example-specific test claims below retain their stated scope.

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 Conversion-dependent; use numeric input

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))

Mathematically recovers A1 when EXP(A1) remains finite and nonzero; numerical rounding, overflow or underflow can prevent the round trip.

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 log-density expression for positive sd:

=-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

The callback requires fVal>0 before applying log. Zero and negative numeric inputs follow its illegal-argument path. A physically empty scalar reference is read as zero, so LN of that reference also fails the domain check. Existing errors propagate rather than being ignored. For very large finite positive binary64 inputs, the logarithm is much smaller than the input; a huge displayed input alone is not proof that LN itself overflows. Upstream overflow and underflow must be diagnosed at their origin.

For scalar numeric functions the checked reader distinguishes genuine empty references, strings, numeric values and errors. It can parse some numeric text, including ordinary integer text, and reads a physically empty referenced cell as zero. Therefore neither “all text is ignored” nor “all blanks always produce an invalid-argument error” is a safe general rule. A formula error propagates; it is not silently removed. Use explicit numeric cells in the reproducible tests, and inspect data types before changing a domain check.

Formula parsing errors are separate from mathematical domain errors. Check the function spelling, parentheses and the semicolon separator used in these examples. Number formatting affects display; the separate Calc precision-as-shown setting can also affect numeric reads, so the reference calculations assume ordinary stored-value precision. Dates and times are stored numeric values, but that does not make applying this mathematical operation physically meaningful to every date serial.

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.

Reproducible numeric controls

Formula Independent reference result
=LN(1) 0
=ROUND(LN(10);10) 2.302585093
=ROUND(LN(EXP(1));10) 1
=ROUND(LN(0.5);10) -0.6931471806
=ROUND(LN(1.05);10) 0.0487901642
=LN(0) ERROR
=LN(-1) ERROR

These are independent mathematical/source controls, not new native application or GUI observations. ERROR denotes an invalid or non-finite source path without inventing an observed localized message. Decimal expectations use the shown rounding precision; full stored results should be retained for subsequent arithmetic.

Complete worksheet and changed-input checks

Enter positive values 0.5,1,2,10 in A2:A5. In B2 enter =LN(A2) and fill down. Rounded to ten decimals, results are -0.6931471806,0,0.6931471806,2.3025850930. Values between zero and one have negative logarithms; a negative result is not evidence of an invalid input.

In C2 enter =EXP(B2) and fill down. The mathematical target is the original A value, subject to numerical precision. Format B to show fewer digits if desired, but do not replace its stored result with the displayed rounded text before the inverse calculation.

Advanced validation and model boundaries

Check product and quotient identities. For positive 2 and 5, LN(2)+LN(5)=LN(10) mathematically, approximately 2.3025850930. LN(10)-LN(2)=LN(5), approximately 1.6094379124. Use these identities only in their positive-input domain.

Solve an exponential parameter with complete inputs. Let starting amount P=100, ending amount A=150 and elapsed time t=2 in consistent units. =LN(150/100)/2 is approximately 0.2027325541 per time unit. Reconstructing 100EXP(rate2) yields the mathematical target 150. This is an algebraic illustration, not a forecast.

Derive a decay constant. If the remaining fraction is 0.25 after time 4, -LN(0.25)/4 is approximately 0.3465735903. The positive constant belongs in EXP(-k*t). Positive fraction, nonzero time and consistent units must be validated separately.

Documentation and verification scope

The original useful examples, named-variable illustrations, shortcodes and design are retained; variables such as Radius, Rate, sd or Time must be defined as cells/names with the required units before those templates are executable. The earlier cross-sheet and Ctrl+Shift+Enter examples describe formula patterns, not a new GUI or array-entry test. Compatibility metadata does not certify identical coercion or boundary behavior in other products.

See the official LN reference, 4.1.16 mathematics help, scalar elementary functions, SIGN and logarithm callbacks, POWER implementation, numeric argument reading, and non-finite result handling. The first help/core snapshots retain October 13 retrieval dates; POWER retains October 14. Numeric-reader and result-handler sources were retrieved October 15. Original introduction and final functioning version remain unknown; the supported 4.1.16 evidence above is separate.