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
| Argument | Type | Required | Default |
|---|---|---|---|
number | number | Required | — |
base | number | Optional | — |
Differences from Excel
A base of 1 returns #NUM! in Formualizer and #DIV/0! in Excel.
Remarks
- If
baseis omitted, base 10 is used. numbermust be positive.basemust 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?.
Related functions
FAQ
Which base values are invalid for LOG?
Base must be positive and not equal to 1; otherwise LOG returns #NUM!.