Excel function

LOGfunction

Returns the logarithm of a number to the base you choose. If omitted, the base is 10.

All versions
=LOG(A2)
A
B
1
2
3
4
5
6
7

Click a cell in the table to change number. Click 1234.567, leave base empty, then set it to 2. Try breaking it on purpose to see the errors.

Result

0.4971495059

number
A2You can also click a cell in the table

The cell with the number to calculate. Click another value in the table.

base

The base of the logarithm. If empty, 10. A base of 1 returns #DIV/0!.

What is the LOG function?

=LOG(number, [base])

LOG returns the logarithm of a number to the base you choose. If you omit the base, it uses 10 and gives the same result as LOG10.

Use it for orders of magnitude or the number of doublings (base 2). Both the number and the base must be greater than 0.

Arguments

number
A positive real number.
base
The base. If omitted, 10.

LOG examples

  1. Example 1. Base 10

    =LOG(10)

    1.

  2. Example 2. Base 2

    =LOG(8, 2)

    An example from Microsoft: 3, because 2 × 2 × 2 = 8.

  3. Example 3. Number of doublings

    =LOG(1000/100, 2)

    Going from 100 to 1000 takes about 3.32 doublings.

Common mistakes

FAQ

How is it different from LN and LOG10?
LN always uses e and LOG10 always uses 10. LOG lets you pick.
Square roots with logs?
Use SQRT or POWER(x, 1/2) for roots.