The LOG function in Google Sheets is a powerful tool for performing logarithmic calculations. It allows users to compute the logarithm of a specified number, leveraging a chosen base. This function is particularly valuable in various fields such as mathematics, engineering, and data analysis, where logarithmic transformations are commonly applied.
Syntax
LOG(number, [base])
- number: The value for which you want to calculate the logarithm.
- base: (Optional) The base of the logarithm. If omitted, Google Sheets defaults to base 10.
Example #1
=LOG(100)
In this case, the function computes the base 10 logarithm of 100, resulting in 2.00.
Example #2
=LOG(8, 2)
This function calculates the logarithm of 8 with a base of 2, which results in a value of 3.00, since 2 raised to the power of 3 equals 8.
Example #3
=LOG(1000, 10)
Here, the function computes the base 10 logarithm of 1000, yielding a result of 3.00, since 10 raised to the power of 3 equals 1000.
Error handling
- NUM! This error occurs when the ‘number’ is less than or equal to zero.
- VALUE! This error is displayed when the input type is incorrect, such as when a text string is provided instead of a number.
- DIV/0! This may occur if the base is set to zero or not specified, leading to an undefined logarithmic operation.