LOG

Returns the logarithmic value of the number passed to the function. If no base is mentioned then calculates logarithm to the base 10.

Syntax

= LOG(value)

= LOG(value, base)

Parameters

value

A number whose log value is to be calculated.   The number can be specified as an integer (e.g., 37), a decimal value (e.g., 37.48), as a string, or as the value of a variable (e.g, UnitPrice).

base (optional)

A number which is the base of the logarithm. The number can be specified as an integer (e.g., 37), a decimal value (e.g., 37.48), as a string, or as the value of a variable (e.g, UnitPrice).

Return Type

Decimal number.

In the case of an error, the function displays an error message: “LOG(value): Error message” (or) “LOG(value, base): Error message”

The function can be used in combination with other functions.

Examples

Example

Returns

= LOG(3)

0.4771

= LOG(-2)

An error message.

= LOG(“$1”, 2)

0

= LOG(10, 2)

3.3219

= LOG(UnitPrice, 3)

The log value of the UnitPrice to the base 3

= LOG(“abcd”, 5)

Displays message “LOG(abcd, 5): Input string was not in a correct format.”

= POWER(LOG(UnitPrice), 2)

The square of the logarithm value of UnitPrice

= MAX(LOG(UnitPrice,3), 12)

The maximum among the logarithm value of UnitPrice to the base 3 and the number 12.