Excel Tutorial

Excel LOG Function



The Excel LOG function returns the base-10 logarithm or logarithm to the specified base of a given number.

The LOG function is a built-in function in Excel that is categorized as a Math/Trig Function. It can be used as a worksheet function in Excel. As a worksheet function, the LOG function can be used as part of a formula in a worksheet cell.

The Excel LOG function can also be used as a VBA function in Excel with a different syntax. For more information, see LOG as VBA function.

Syntax

LOG(number, base)

Parameters

number Required. Specify a numerical value greater than 0 to get the logarithm of.
base Optional. Specify base of the logarithm. Default value is 10.

Return Value

Returns logarithm of a value.

Notes

  • If either of the arguments is less than or equal to 0, LOG returns #NUM! error.
  • For base equal to 1, LOG returns #DIV/0! error.
  • If the argument is a non-numeric value, LOG returns #VALUE! error.

Example: Using as Worksheet Function

The example below shows how to use the LOG function as worksheet function.

Excel LOG function, returning specified base logarithm of a value

Based on the Excel spreadsheet above, the output of the following worksheet formula will be:

=LOG(B5,C5)
Result: 3

=LOG(B6,C6)
Result: 3

=LOG(B7,C7)
Result: 3.321928095

=LOG(B8,C8)
Result: 2

=LOG(B9,C9)
Result: 2.430676558

=LOG(B10,C10)
Result: 5

Example: Using without base parameter

The LOG function can be used without base parameter, in that case base-10 logarithm of the given number is calculated.

Excel LOG function, returning base-10 logarithm of a value

Based on the Excel spreadsheet above, the output of the following worksheet formula will be:

=LOG(B5)
Result: 0

=LOG(B6)
Result: 1

=LOG(B7)
Result: 2

=LOG(B8)
Result: 3

=LOG(B9)
Result: 4

=LOG(B10)
Result: 1.698970004

=LOG(B10)
Result: 2.698970004

❮ Excel Functions