# LOG function in Excel

> LOG returns the logarithm of a number in the base you choose: the power the base must be raised to in order to reach the number.

Source: https://spreadsheetpractice.com/functions/log · Updated October 28, 2026 · Formulas and results on this page were run by the Spreadsheet Practice formula engine on November 20, 2026

## Quick answer

- **What it does:** LOG returns the logarithm of a number in the base you choose: the power the base must be raised to in order to reach the number.
- **Syntax:** `=LOG(number, [base])`
- **Most common use:** `=LOG(B2)` returns 3 (No base given, so base 10: 1,000 is 10 to the 3rd)
- **Available in:** Every current version
- **Category:** [Math functions](https://spreadsheetpractice.com/functions/category/math)
- **Returns:** The logarithm of number in base.
- **Google Sheets:** Works the same in Google Sheets.

## What it does

LOG returns the logarithm of a number in the base you choose: the power the base must be raised to in order to reach the number. Leave the base out for base 10. It answers questions like "how many years until this doubles?" with =LOG(2,1+rate).

## Syntax

`=LOG(number, [base])`

| Argument | Required? | What it is |
|---|---|---|
| `number` | Required | A positive number. |
| `base` | Optional | The base of the logarithm. Leave it out for base 10. |

## Examples

Each result was calculated by running the formula on the sample sheet.

| Cell | Formula | Result | What it shows |
|---|---|---|---|
| D2 | `=LOG(B2)` | 3 | No base given, so base 10: 1,000 is 10 to the 3rd |
| D3 | `=LOG(B3,2)` | 6 | Base 2: 64 is 2 to the 6th |
| D4 | `=LOG(2,1+B4)` | 10.24476835 | Years to double at 7% growth: about 10.2 |

### The sample sheet

Every formula above runs on this data:

|  | A | B | C | D |
|---|---|---|---|---|
| 1 | Input | Value |  |  |
| 2 | Number | 1000 |  | 3 |
| 3 | Bits | 64 |  | 6 |
| 4 | Growth rate | 7% |  | 10.24476835 |

## Common mistakes

| What you see | Why, and how to fix it |
|---|---|
| #NUM! | number or base is zero or negative. Logarithms only exist for positive numbers. |
| #DIV/0! | The base is 1, which can't be used as a logarithm base. |
| Expected the natural log | LOG defaults to base 10, not e. Use LN for natural logs. |

## Tips

- Years to reach a target: =LOG(Target/Start,1+Rate).

## Related functions

- [LOG10](https://spreadsheetpractice.com/functions/log10): LOG10 returns the base-10 logarithm of a number: how many times 10 is multiplied to reach it.
- [LN](https://spreadsheetpractice.com/functions/ln): LN returns the natural logarithm of a number: the power you would raise e to in order to get it.
- [EXP](https://spreadsheetpractice.com/functions/exp): EXP returns e (about 2.71828) raised to a power.
- [POWER](https://spreadsheetpractice.com/functions/power): POWER raises a number to a power, the same as the ^ operator.

## Questions

### How do I calculate log base 2 in Excel?

Use =LOG(A2,2).

### What base does LOG use by default?

Base 10. =LOG(100) returns 2.

### How do I find how long it takes to double my money?

Use =LOG(2,1+rate). At 7% that's about 10.2 years.

## Practice

A graded LOG exercise ("Years to reach the target") is on [the LOG page](https://spreadsheetpractice.com/functions/log). It is checked instantly, then re-checked on changed data.

---

Spreadsheet Practice (https://spreadsheetpractice.com) teaches spreadsheet formulas by practice: every exercise is graded in a live grid and re-checked on changed data.
