In Excel: use =LOG(number, [base]) — base 10 by default, so =LOG(1000) returns 3, and =LOG(8, 2) returns 3 for base 2.
On this page8
Syntax
Arguments
| Argument | required / optional | Description |
|---|---|---|
number | required | A positive value. Zero or negative returns #NUM!. |
base | optional | The logarithm base. Defaults to 10. |
Related functions
Select the result cell and type =LOG(.
Select the positive value or ratio.
Add a comma and the base if it is not 10 — 2 for doublings, EXP(1) for natural.
Press Enter.
Need it as an auditable file?
Ships inside the linked template — formula-driven, unlocked, audit-ready.
What this does
LOG answers "what exponent turns the base into this number". Its default base is 10, and the optional second argument accepts any base, which makes it the general-purpose logarithm where LN is locked to e and LOG10 is locked to ten. The everyday uses are order-of-magnitude work — how many digits a number has, how many doublings separate two values, sizing a logarithmic chart axis — rather than pure maths. Only positive inputs are valid. The same idea underpins a lot of everyday Excel work, so the few minutes spent getting it right here pay back across every sheet you build afterwards. Treat it as a pattern, not a one-off, and it stops being something you look up and starts being something you reach for. Treat “excel log function” as a small repeatable workflow rather than a one-off click you hope to remember next time. Use a small test block before the live file, so any surprise in the affected formula shows up while it is still harmless. When a formula is involved, keep the inputs labelled beside it, reference cells instead of typing values, and apply number formatting only after the result checks out. That turns a calculation you can defend to a CFO or an auditor into a method you can reuse, explain, and defend when the workbook leaves your screen.
A worked example
How many times must capacity double to grow from 500 to 8,000? =LOG(8000/500, 2) returns 4. The order of magnitude of 47,000: =INT(LOG(47000)) returns 4. Base-2 depth for a binary structure of 1,024 items: =LOG(1024, 2) returns 10. LOG is the general logarithm — the one that answers order-of-magnitude and doubling questions without forcing you to remember which fixed-base variant to reach for. One habit worth forming early: name the cells that hold your inputs, so the formula reads in plain language instead of a string of cell addresses. A reviewer — or you in three months — can then follow the logic without decoding what B7 and D2 were supposed to mean, which is most of what makes a sheet maintainable.
In Google Sheets
Google Sheets handles this almost identically to Excel. The formula syntax above is the same, and the menu lives under a slightly different label rather than a ribbon tab. Use the platform toggle at the top of the page to switch every keyboard shortcut between Windows and Mac, and expect at most cosmetic differences in naming. The aim was to get you unstuck fast and leave you a little more capable than a copy-paste would. The answer is at the top and the detail above shows why it holds — so the next time a colleague asks, you can answer without reaching for search. Here is the takeaway for “excel log function”: copy the answer if you are busy, but if you have a spare few minutes, rebuild the example in Excel yourself with the tool above open beside it. That single pass — type it, run it, watch the result move when you change an input — is what turns a formula you found into a technique you trust. Keep your inputs labelled and referenced, never hard-coded, and the same sheet stays correct and auditable as it grows. Done that way, you will not need to look this up again, and you will be the person others ask.
Common mistakes
- Assuming LOG means natural log; it defaults to base 10, and
LNis the natural one. - Passing zero or a negative value, which returns
#NUM!. - Omitting the base when a base other than 10 was intended, which silently returns a plausible but wrong number.
Frequently asked questions
What base does LOG use by default?
Base 10. Pass a second argument for anything else, or use LN for base e.
What is the difference between LOG and LOG10?
LOG10 is base 10 only. LOG defaults to base 10 but accepts any base, so LOG covers everything LOG10 does.
How many doublings are between two numbers?
=LOG(larger/smaller, 2) gives the count of doublings directly.