🚀The world's best VBA AI has evolved. ExcelMaster is now an autonomous Agent.Read more →
Back to Blog

Excel EXP, LN & LOG — Logarithms, Growth Rates, and the Default-Base Trap

|

Excel EXP, LN & LOG — Logarithms, Growth Rates, and the Default-Base Trap

TL;DR — Exponentials and logarithms are the same relationship read in opposite directions. EXP(x) returns e to the power x (continuous growth forward). A logarithm runs it backwards — it solves for the exponent: LN(x) is the natural log (base e), LOG10(x) is base 10, and LOG(x, [base]) lets you choose — defaulting to base 10, not the natural log. That default is the trap that silently wrong-foots anyone coming from math or code. Logs of zero or negative numbers are #NUM!. The two formulas worth memorizing: geometric mean = EXP(AVERAGE(LN(range))) and periods-to-target = LN(target)/LN(rate).

=EXP(1)              ' -> 2.71828...   e, the growth constant
=LN(2.71828)         ' -> 1            natural log undoes EXP
=LOG10(1000)         ' -> 3            base 10
=LOG(8, 2)           ' -> 3            "2 to what power is 8?"
=LOG(100)            ' -> 2            NO base = base 10, NOT natural log

Powers grow a number forward; logarithms ask the reverse question — what exponent got me here? For most spreadsheet users this family earns its place doing exactly two finance jobs: averaging growth rates honestly, and solving for "how long until…". Learn the inverse relationship and the default-base gotcha and the rest follows.

What you'll learn

  • The mental model: a logarithm is exponentiation solved for the exponent
  • The three logs — LN, LOG10, LOG — and which base each uses
  • The default-base trap: LOG(x) is base 10, not natural log
  • Why LN(0) and LOG(-5) are #NUM! — guarding the domain
  • The two formulas that matter: geometric mean and years-to-target

The mental model: a log is a power, solved backwards

POWER and EXP answer a forward question: start here, grow at this rate for this long — where do I end up? A logarithm answers the reverse: I ended up here — what exponent got me from the base to this value?

=POWER(2, 3)    ' -> 8    forward: 2 to the 3rd power
=LOG(8, 2)      ' -> 3    backward: 2 to WHAT power is 8?

That's the entire idea. EXP and LN are exact inverses of each other — each undoes the other — which is the machinery behind every practical use below:

=LN(EXP(5))     ' -> 5
=EXP(LN(5))     ' -> 5

If POWER is the forward gear, LN/LOG are reverse. Where POWER gave you CAGR when you knew the years and wanted the rate, a logarithm gives you the years when you know the rate and want the count. Same relationship, different unknown.

Three logs, and which base each one uses

Excel ships three logarithm functions, and the only thing you must keep straight is the base each assumes:

=LN(x)          ' natural log — base e (2.71828...)
=LOG10(x)       ' base 10, fixed
=LOG(x)         ' base 10 by DEFAULT when no base is given
=LOG(x, base)   ' any base you specify — LOG(8,2) = 3

LN is unambiguous (always base e). LOG10 is unambiguous (always base 10). The flexible one is LOG, and its flexibility is exactly where the trap lives.

The default-base trap: LOG(x) is base 10, not natural log

In mathematics and in most programming languages, log written without a base usually means the natural log. In Excel it does not:

=LOG(100)          ' -> 2      base 10:  10^2 = 100
=LN(100)           ' -> 4.605  natural log, base e
=LOG(100, EXP(1))  ' -> 4.605  natural log spelled out via LOG

Rule: LOG with one argument is base 10. If you want the natural log, use LN — never a bare LOG. This mismatch produces a plausible number, not an error, so a model ported from a textbook or a Python script can be quietly off by a constant factor (about 2.303×, the ratio between the two bases). When in doubt, write the base explicitly and remove all ambiguity: LOG(x, 10) or LOG(x, EXP(1)).

Domain errors: LN(0) and logs of negatives are #NUM!

Logarithms are only defined for positive numbers, so Excel returns #NUM! for zero or negative inputs:

=LN(0)      ' -> #NUM!
=LOG(-5)    ' -> #NUM!
=LN(-3)     ' -> #NUM!

This bites in practice when you log-transform a data column — for a chart axis, a growth calc, or a regression — and one stray zero or negative sits in the range. Guard the domain before you transform, e.g. filter the range or test =IF(x>0, LN(x), NA()) so the bad row is visible rather than crashing the whole calculation. It's the same domain discipline that makes SQRT reject negatives in the POWER & SQRT guide.

The two formulas that actually matter

Strip away the scientific uses and almost every business need for this family reduces to two formulas. Memorize these and you've captured 95% of the value.

1. Geometric mean — averaging growth rates honestly. A plain AVERAGE of yearly growth rates overstates compound performance. The geometric mean corrects it, and the log route is the robust way to compute it across a range:

=EXP(AVERAGE(LN(growth_ratios)))    ' geometric mean of the ratios
' ratios like 1.10, 0.95, 1.20  (a +10%, -5%, +20% run)

It works because logs turn multiplication into addition: averaging the logs, then EXP-ing back, is the same as taking the nth root of the product — a geometric mean without an unwieldy product term. (Excel also has a GEOMEAN function; the log form is worth knowing because it composes with FILTER, weights, and conditions.)

2. Periods to a target — "how long until…". When you know a rate and want the number of periods to reach a target, the logarithm hands it to you directly:

=LN(2) / LN(1.07)          ' -> 10.24   years to double at 7%
=LOG(2, 1.07)              ' -> 10.24   same answer, LOG with an explicit base
=LN(Target/Start) / LN(1 + rate)   ' general form

This is the exact inverse of the CAGR formula from the POWER guide: there you knew the periods and solved for the rate; here you know the rate and solve for the periods. One more log worth a mention — log returns, =LN(P1/P0), the continuously-compounded return that adds cleanly across periods, which is why quantitative finance prefers it to simple percentage change.

The judgment call

For day-to-day spreadsheet work, treat this family as two tools with a warning label. The two tools are geometric mean (EXP(AVERAGE(LN(...)))) and solve-for-periods (LN(target)/LN(rate)); reach for them whenever "average growth" or "how many periods" comes up, and you'll rarely need the rest. The warning label is the default base: never write a bare LOG when you mean natural log — use LN, or state the base. Everything else (log scales, decibels, entropy) is genuine science, and if you're doing that you already know which base you need.

How ExcelMaster helps

The default-base trap is precisely the kind of silent error that survives every visual check — the numbers look reasonable, they're just scaled wrong. Ask ExcelMaster for "the geometric mean of these annual returns" and it writes EXP(AVERAGE(LN(...))) (or GEOMEAN) correctly, not a naive AVERAGE that overstates the result. Ask "how many years to double at 7%?" and it produces LN(2)/LN(1.07) with the right base throughout. And when you say "take the natural log of this column," it reaches for LN — never a bare LOG — and guards the zeros and negatives that would otherwise return #NUM!.

Frequently asked questions

What does the EXP function do in Excel?

=EXP(x) returns the constant e (≈2.71828) raised to the power x. =EXP(1) gives e itself; =EXP(0) gives 1. It models continuous exponential growth and is the exact inverse of the natural logarithm, so =EXP(LN(x)) returns x.

What is the difference between LN and LOG in Excel?

=LN(x) is the natural logarithm, always base e. =LOG(x) uses base 10 when no base is given, and =LOG(x, base) lets you pick any base. So LN and a bare LOG are not the same — for a natural log always use LN, not LOG.

Why does LOG give a different answer than I expected?

Almost always the base. In Excel, =LOG(x) with no second argument is base 10, while in math and many programming languages log means natural log (base e). Use =LN(x) for the natural log, or specify the base explicitly, e.g. =LOG(x, 2) or =LOG(x, EXP(1)).

How do I calculate a geometric mean with logarithms in Excel?

Use =EXP(AVERAGE(LN(range))), where the range holds growth ratios (like 1.10 for +10%). Averaging the natural logs and exponentiating back gives the geometric mean — the correct way to average compounding rates. Excel also has a dedicated GEOMEAN function.

Why do I get #NUM! from LN or LOG in Excel?

Logarithms are only defined for positive numbers, so =LN(0), =LN(-3), and =LOG(-5) all return #NUM!. Check the range for zeros or negatives before log-transforming — for example =IF(x>0, LN(x), NA()) to surface bad rows instead of crashing the calculation.

Tested in

Tested in: Excel 365 (Windows 11) — last verified 2026-07-10.

Related guides: Excel POWER & SQRT · Excel ABS & SIGN · Excel ROUND · Excel SUMPRODUCT