Quick Answer

LOG Function

Returns the logarithm of a number to a given base (default 10).

✓ Excel✓ Google SheetsExcel All versions

Syntax

LOG
(number, [base])

Parameters

ParameterDescriptionRequired
numberThe positive real number for which you want the logarithm.Required
baseThe base of the logarithm. Optional; defaults to 10 if omitted.Optional

Basic Example

Base-10 log of 1000

=LOG(1000)
Result3

With the base omitted, LOG uses 10; 10³ = 1000, so the result is 3.

Advanced Examples

Example 1: Logarithm in base 2

Measuring bits or orders of magnitude.

Specify base 2 explicitly.

=LOG(8, 2)
Result: 3
2³ = 8, so the base-2 logarithm of 8 is 3.

Example 2: Base-10 explicitly

Clarity in a formula.

Pass 10 as the base.

=LOG(100, 10)
Result: 2
10² = 100, giving 2.

How LOG Works

LOG computes log_base(number), the exponent to which the base must be raised to equal the number. When base is omitted it defaults to 10. Mathematically LOG(n, b) = LN(n) / LN(b).

1
Select the cell
Click the cell for the result.
2
Enter the formula
Type =LOG(number, [base]); omit base for base 10.
3
Press Enter
The logarithm appears.

Important Notes & Limitations

  • The number must be positive; otherwise #NUM!.

  • The base must be positive and not equal to 1; base 1 returns an error.

  • Omitting the base yields base 10, which some users confuse with natural log.

Common Errors & Fixes

#NUM!Number is 0/negative, or base is invalid (e.g. 1 or negative).

Fix: Use a positive number and a positive base other than 1.

#VALUE!Non-numeric argument.

Fix: Supply numeric values.

Download Practice File

Practice LOG with Real Data

Download a sample CSV file with pre-populated data and practice exercises for the LOG function. Works in both Excel and Google Sheets.

Works in Google SheetsCompatible with ExcelIncludes exercises

File format: CSV (comma-separated values) - opens in Excel, Google Sheets, and all spreadsheet apps

Frequently Asked Questions

What base does LOG use when I omit the base?
Base 10. Use LOG10 for an explicit base-10 log, or LN for base e.
How do I compute a natural logarithm?
Use LN, or LOG(number, EXP(1)).
Why does LOG return #NUM!?
Usually because the number is not positive, or the base is 1 or negative.