LOG Function (LibreOffice Calc)
The LOG function in LibreOffice Calc returns the logarithm of a number with a specified base. It defaults to base 10 when no base is provided. Learn syntax, examples, common errors, and best practices.
Compatibility
▾| Excel | ✔ |
| Gnumeric | ✔ |
| Google_sheets | ✔ |
| Libreoffice | ✔ |
| Numbers | ✔ |
| Onlyoffice | ✔ |
| Openoffice | ✔ |
| Wps | ✔ |
| Zoho | ✔ |
What the LOG Function Does ▾
- Computes logarithms with a specified base
- Defaults to base 10 when no base is provided
- Works with positive real numbers
- Useful for scaling, scientific notation, and data transformation
- Supports cell references, formulas, and expressions
It is designed to be flexible, precise, and universally compatible.
Syntax ▾
LOG(number; [base])
Arguments
-
number:
A positive real number. Must be greater than 0. -
base (optional):
The logarithmic base.- Default: 10
- Must be positive and not equal to 1
Basic Examples ▾
Base-10 logarithm
=LOG(100)
Returns 2.
LOG with a cell reference
=LOG(A1)
Computes log base 10 of A1.
LOG with a custom base
=LOG(8; 2)
Returns 3 (because 2³ = 8).
LOG of a product
=LOG(A1 * B1)
Equivalent to LOG(A1) + LOG(B1).
Advanced Examples ▾
Convert exponential form to linear form
=LOG(A1)
Useful for scientific scaling.
Change of base formula
=LOG(A1; B1)
Equivalent to:
LN(A1) / LN(B1)
Solve for exponent in a power equation
=LOG(A2 / A1; B1)
Solves B1^x = A2/A1.
LOG for decibel calculations
=20 * LOG(A1)
Used in audio and signal processing.
LOG for pH calculations
=-LOG(A1)
Where A1 is hydrogen ion concentration.
LOG for financial scaling
=LOG(A1; 1 + B1)
Useful for growth factor transformations.
LOG for geometric mean
=EXP(AVERAGE(LN(A1:A10)))
Uses LN internally but LOG can help interpret results.
Common Errors and Fixes ▾
Err:502 — Invalid argument
Occurs when:
- number ≤ 0
- base ≤ 0
- base = 1
- number or base is non‑numeric
- a formula feeding LOG returns an error
Fix:
Ensure both arguments are valid positive numbers and base ≠ 1.
LOG returns a negative value unexpectedly
Cause:
- LOG(x) < 0 when 0 < x < 1
Example:LOG(0.1)→-1
This is mathematically correct.
LOG returns 0 unexpectedly
Possible causes:
- number = 1
- number is stored as text
- cell is empty
Fix:
Convert text to numbers using:
Data → Text to Columns → OK
LOG returns Err:503 (overflow)
Occurs when:
- number is extremely large
- intermediate calculations overflow
Best Practices ▾
- Use LOG for base‑10 or custom‑base logarithms
- Use LN for natural logarithms
- Avoid passing zero or negative numbers
- Use LOG to linearize exponential relationships
- Use LOG with ratios for elasticity and growth calculations
Related Patterns and Alternatives ▾
- Use LN for natural logarithms
- Use EXP to invert LN
- Use POWER for exponentiation
- Use A1 ^ B1 for non‑logarithmic exponent bases
- Use LOG(A2/A1) for growth rate calculations
By mastering LOG and its combinations with other math functions, you can build powerful, scalable models in LibreOffice Calc that handle logarithmic and exponential relationships with precision.