LOG function
LOG returns the logarithm of a number in the base you choose, answering what power of the base gives that number. If you leave out the base, it uses 10.
Example
Read it as a sentence: take the base 2 log of the numbers in A1:A3, which gives 0.
Excel shows 0
A
1
1
2
2
3
3
Data
Syntax
LOG(number, [base])
Arguments in [square brackets] are optional.
-
number(required) - A positive number.
-
base(optional) - The logarithm base. Defaults to 10.
Returns: The logarithm of the number in the chosen base.
What Excel actually returns
Each formula below was run in desktop Excel. The result is exactly what the cell showed, errors included.
| Formula | Excel shows | Case |
|---|---|---|
=LOG(100) | 2 | 100 |
=LOG(8,2) | 3 | 8,2 |
=LOG(8,0.5) | -3 | Base 0.5 |
=LOG("100") | 2 | Text number |
=LOG(Data!A1:A3,2) | 0 | Spill |
=LOG(8,1) | #DIV/0! | Base 1 |
=LOG(8,0) | #NUM! | Base 0 |
=LOG(8,-2) | #NUM! | Base negative |
The Data sheet these formulas read
A cell that starts with = holds that formula.
A
1
1
2
2
3
3
Data
Watch out for
- Leaving base out means 10, not e.
- Zero or negative inputs return #NUM!.
Where it works
- Excel
- LOG is in every version of Excel from 2007 on.
- Google Sheets
- Same name, same behaviour for everyday use.
Part of Math and trig functions. Every result on this page was measured in desktop Excel, build 16.0.20527. Last updated .