Math & Trig

LOG Formula

LOG returns the logarithm of a number to a specified base. If you omit the base, it defaults to 10. It's more flexible than LN (base e) or LOG10 (base 10) because you can use any base — binary (base 2) for computer science, base 10 for scientific notation, or custom bases for specific applications.

Syntax

LOG(number, [base])
ParameterDescription
number Parameter of the LOG function.
[base] (Optional.) Parameter of the LOG function.
Try LOG in Viztab — free, no signup

Examples

Base 10 (default)

Formula
=LOG(1000)
Returns 3. 10^3 = 1000, so log base 10 of 1000 is 3.

Base 2 (binary)

Formula
=LOG(256, 2)
Returns 8. 2^8 = 256. Useful for computing: 256 bytes = 2^8, so you need 8 bits.

Custom base

Formula
=LOG(81, 3)
Returns 4. 3^4 = 81. The log base 3 of 81 is 4.

Common Errors

#NUM!

The number must be positive and the base must be positive and not equal to 1. =LOG(-5), =LOG(10, 0), or =LOG(10, 1) all return #NUM!.

#VALUE!

Non-numeric arguments return #VALUE!.

Tips

Default base is 10

=LOG(100) returns 2 because the base defaults to 10. Always specify the base explicitly if you mean something other than 10.

Bit counting

=CEILING(LOG(n, 2), 1) gives the number of bits needed to represent n values. Essential for computer science calculations.

pH scale

pH = -LOG(hydrogen_ion_concentration). The LOG function directly models the pH scale used in chemistry.

Try LOG in Viztab

Import your data and use LOG with 370+ other formulas. No signup required.

Open Viztab

Related Formulas