Category: FUNCTION | Updated: 2026-11-22
[LOG Function] How to Calculate the Logarithm of a Number to a Given Base
Syntax
=LOG(value, [base])
- value: A positive real number for which you want to calculate the logarithm.
- base (optional): A positive real number to use as the base of the logarithm. Defaults to
10if omitted.
Example Table
Examples of calculating logarithms with bases such as 2 and 10.
| Value (Col A) | Base (Col B) | Formula | Output | Explanation |
|---|---|---|---|---|
| 8 | 2 | =LOG(A2, B2) |
3 | 2³ = 8, so the result is 3 |
| 100 | 10 | =LOG(A3, B3) |
2 | 10² = 100, so the result is 2 |
| 1000 | (Omitted) | =LOG(A4) |
3 | Omitting the base defaults it to 10 |
| 81 | 3 | =LOG(A5, B5) |
4 | 3⁴ = 81, so the result is 4 |
Common Errors and Caveats
- #NUM! error: Occurs if
valueis0or less, or ifbaseis0or less. - #DIV/0! error: Specifying
1as thebasecauses division by zero internally, resulting in a#DIV/0!error.
Frequently Asked Questions
Q. What happens if you omit the second argument (base) in the LOG function?
A. If you omit the base argument, it defaults to 10, returning the same result as the LOG10 function (common logarithm).
Q. Why does specifying 1 as the base cause an error?
A. Because 1 raised to any power is always 1, so a logarithm with base 1 is undefined. The base must be a positive number other than 1.