LOG Function (OpenOffice Calc)
The LOG function in OpenOffice Calc returns the logarithm of a number to a specified base. 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 LOG function in OpenOffice Calc returns the logarithm of a number using a specified base. This makes LOG extremely flexible for scientific calculations, data transformations, engineering formulas, and any scenario where logarithmic scaling is required.
What the LOG Function Does
- Computes logarithms with a positive base other than 1
- Supports base‑10, base‑2, natural logs, and custom bases
- Useful for scaling, data normalization, and scientific modeling
- Works across sheets
- Pairs naturally with POWER, LN, and EXP
LOG is ideal when you need custom logarithmic transformations.
Syntax
LOG(number; base)
Arguments:
- number — A positive numeric value
- base — A positive numeric value (≠ 1)
Domain Rules
| Input | Valid? | Notes |
|---|---|---|
| number > 0 | ✔ | Required |
| number = 0 | ✘ | Undefined |
| number < 0 | ✘ | Undefined |
| base > 0 and base ≠ 1 | ✔ | Required |
| base = 1 | ✘ | Undefined |
| base < 0 | ✘ | Undefined |
Mathematically:
[ \log_b(x) \text{ is defined only for } x > 0 \text{ and } b > 0, b \neq 1 ]
Basic Examples
Log base 10 (default)
=LOG(100)
Result: 2
Log base 2
=LOG(8; 2)
Result: 3
Log base e (natural log)
=LOG(A1; EXP(1))
Equivalent to LN(A1).
Log using cell references
=LOG(A1; B1)
Advanced Examples
Change of base formula
=LOG(A1; B1)
Equivalent to:
=LN(A1) / LN(B1)
Logarithmic scaling for charts
=LOG(A1; 10)
Convert exponential form to linear
Given:
[ y = a \cdot b^x ]
Recover x after accounting for the scale coefficient a:
=LOG(y/a; b)
This requires nonzero a, y/a>0 and a positive base other than 1. When a and y are positive, LOG(y;b) alone includes the offset LOG(a;b).
Solve for exponent
[ x = \log_b(y) ]
Calc:
=LOG(y; b)
Solve for base
[ b = y^{1/x} ]
Calc:
=POWER(y; 1/x)
LOG across sheets
=LOG(Sheet1.A1; 2)
Logarithmic normalization
=LOG(A1 + 1; 10)
Logarithmic regression (manual components)
=LOG(Y1:Y10; 10)
Confirm with Ctrl+Shift+Enter.
Common Errors and Fixes
The source requires number>0, base>0 and base!=1. An omitted base is explicitly set to 10; it is not the same as supplying a reference to a physically empty base cell, which the scalar reader treats as zero. The source then computes log(number)/log(base). Existing argument errors propagate. Exact localized error displays, text parsing and numerical behavior arbitrarily close to one are outside native verification.
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 LOG for custom‑base logarithms
- Use LN for natural logs
- Use LOG10 for base‑10 logs (or LOG with omitted base)
- Validate inputs to avoid negative or zero values
- Convert imported text numbers to real numbers
- Use named ranges for cleaner formulas
- Use LOG for scaling, normalization, and scientific modeling
Reproducible numeric controls
| Formula | Independent reference result |
|---|---|
=LOG(100) |
2 |
=LOG(8;2) |
3 |
=LOG(1;2) |
0 |
=LOG(0.25;2) |
-2 |
=LOG(8;0.5) |
-3 |
=LOG(0;2) |
ERROR |
=LOG(8;1) |
ERROR |
=LOG(8;0) |
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 values 1,2,4,8,16 in A2:A6. In B2 enter =LOG(A2;2) and fill down. Mathematical results are 0,1,2,3,4. In C2 enter =POWER(2;B2) and fill down; the target values reconstruct A. This makes the logarithm’s meaning as an exponent explicit.
In D2 enter =LOG(A2;0.5) and fill down. Results are 0,-1,-2,-3,-4. A base between zero and one is valid but reverses the direction: increasing positive inputs produce decreasing logarithms. A base need not be greater than one.
Advanced validation and model boundaries
Account for a scale coefficient. For y=a*b^x with a=3, b=2 and x=4, y is 48. Solving for x requires LOG(y/a;b), so LOG(48/3;2)=4. LOG(48;2) is approximately 5.5849625007 and includes the contribution LOG(3;2). The coefficient cannot simply be dropped.
Check change of base with controls. LOG(81;3)=4 mathematically, and LN(81)/LN(3) gives the same value within numerical precision. The pinned implementation directly uses that logarithm quotient. Rounding either numerator or denominator first can change the final result.
Understand bases near one. LOG(2;1.01) is approximately 69.6607168936. When the base approaches one, its natural logarithm approaches zero and sensitivity grows. Exactly one is invalid, and a base so close to one that it rounds to one also fails. Small positive base by itself is not the generic cause of overflow stated in some simplified explanations.
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 LOG 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.