Formualizer Docs

LOG

Returns the logarithm of a number for a specified base.

The Formualizer engine in this repository at 0.15.0 plus unreleased changes computes the example results. Known differences from Excel are listed on this page.

Syntax

=LOG(number, [base])

Arguments

ArgumentTypeRequiredDefault
numbernumberRequired—
basenumberOptional—

Differences from Excel

A base of 1 returns #NUM! in Formualizer and #DIV/0! in Excel.

Remarks

  • If base is omitted, base 10 is used.
  • number must be positive.
  • base must be positive and not equal to 1.

Error cases

  • Invalid domains return #NUM!.

Examples

Use the default base to evaluate a power of ten.

Formula =LOG(100)

Expected result 2

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Supply base two to compute a binary logarithm.

Formula =LOG(32,2)

Expected result 5

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

The logarithm of one is zero in any valid base.

Formula =LOG(1)

Expected result 0

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

A logarithm with base one is undefined.

Formula =LOG(100,1)

Expected result #NUM!

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Base-10 logarithm

Formula =LOG(1000)

Expected result 3

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Base-2 logarithm

Formula =LOG(8,2)

Expected result 3

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

FAQ

Which base values are invalid for LOG?

Base must be positive and not equal to 1; otherwise LOG returns #NUM!.

Implementation

Engine source

On this page