How to Use the LN Function in Excel: Complete Guide to Natural Logarithms
Master how to LN in Excel with step-by-step examples, real use cases, and pro tips. 💡 Learn natural logarithms fast.

Learning how to LN in Excel opens up a powerful mathematical tool that data analysts, scientists, engineers, and finance professionals rely on every single day. The LN function calculates the natural logarithm of a number — that is, the logarithm to the base e, where e ≈ 2.71828. Whether you are modeling exponential growth, calculating compound interest, or running statistical regressions, the LN function is indispensable. You can also explore how to use ln function in excel alongside other essential Excel skills to round out your spreadsheet expertise.
The natural logarithm is the inverse of the exponential function. In plain English, if you raise e to some power x, the LN of the result brings you back to x. For example, LN(e) equals exactly 1, and LN(1) equals exactly 0. This mathematical relationship makes LN especially useful in scenarios where quantities grow or decay at rates proportional to their current value — think population growth, radioactive decay, or continuously compounded returns in finance.
Excel's LN function is remarkably simple to write: you just type =LN(number) into any cell, where number is any positive real number or a cell reference pointing to one. The function returns a decimal value representing the natural log. You cannot pass zero or a negative number — Excel will return a #NUM! error in those cases. This constraint exists because the natural logarithm is undefined for non-positive inputs, a fundamental property of logarithmic math that no software workaround can bypass.
Many spreadsheet beginners confuse LN with the LOG function, which calculates base-10 logarithms by default. While LOG10 and LOG are extremely common in everyday math, the natural logarithm base e appears far more often in advanced analytics, machine learning feature engineering, and scientific computations. Understanding when to use LN versus LOG is a critical skill that separates competent Excel users from truly proficient ones who can tackle complex quantitative problems without hesitation.
The LN function integrates seamlessly with Excel's broader formula ecosystem. You can nest it inside SUM, AVERAGE, IF, or ARRAYFORMULA structures to perform bulk logarithmic transformations across large datasets in seconds. For instance, a data scientist transforming skewed revenue data before building a regression model might write =LN(A2) dragged down an entire column of thousands of rows — a task completed in moments that would take hours by hand or require a separate programming environment.
The function also pairs naturally with Excel's EXP function, which computes e raised to a given power. Since EXP and LN are mathematical inverses, combining them lets you round-trip numbers through transformations: apply LN to compress a wide range of values, perform operations, then apply EXP to restore the original scale. This pattern appears constantly in finance, where analysts work in log-return space for statistical tractability before converting back to price space for reporting.
Throughout this guide, you will find step-by-step instructions, real-world examples drawn from finance and science, common error scenarios and how to avoid them, and practical tips for combining LN with other Excel functions. By the end, you will have the confidence to deploy natural logarithms in any spreadsheet challenge — from simple one-cell calculations to sophisticated analytical models involving thousands of data points.
Excel LN Function by the Numbers

How to Use the LN Function in Excel: Step-by-Step
Open Your Spreadsheet and Select a Cell
Type the LN Formula
=LN( into the selected cell. Excel will immediately display a tooltip showing the function's syntax: LN(number). You can type a literal number such as =LN(100) or reference another cell such as =LN(A2) to pull the input dynamically from your dataset.Reference Your Input Value
=LN(A2) where A2 holds the value 2.71828 will return approximately 1.0000. If your input is a formula result, LN wraps around it seamlessly — for instance, =LN(SUM(A2:A10)).Close the Parenthesis and Press Enter
) and press Enter. Excel immediately computes the natural logarithm and displays the result. The value will be a decimal number — positive for inputs greater than 1, zero for an input of exactly 1, and negative for inputs between 0 and 1 (exclusive).Drag the Formula Down for Multiple Rows
Format the Output Cell as Needed
One of the most common real-world applications of the LN function is in financial modeling, specifically when calculating continuously compounded interest rates or log returns on investment portfolios. A log return is defined as LN(ending price / beginning price), and it has several statistical advantages over simple percentage returns: log returns are time-additive, more symmetrically distributed, and work better with normal distribution assumptions used in options pricing models like Black-Scholes. Analysts at investment banks and hedge funds routinely build entire return series using LN formulas dragged across years of daily price data.
In scientific research, the LN function appears wherever quantities follow exponential laws. Radioactive decay, bacterial growth, pharmacokinetics (how drugs are absorbed and eliminated by the body), and heat transfer all obey equations of the form y = a × e^(bx). To linearize these relationships for regression analysis, scientists take the natural log of both sides, transforming a curved relationship into a straight line that standard linear regression can handle. Excel's LN function makes this transformation trivial — one column of raw measurements becomes a column of log-transformed values with a single formula.
The LN function is equally valuable in data science and machine learning preprocessing. Many real-world datasets — income distributions, city populations, website traffic volumes, and product prices — are right-skewed, meaning a few very large values distort the distribution. Applying LN compresses the right tail, producing a more symmetric, approximately normal distribution that many ML algorithms handle better. A data scientist preparing features for a gradient-boosted model might apply =LN(A2+1) — adding 1 first to handle any zero values — across thousands of rows in seconds.
For actuarial science and insurance, mortality tables and survival analysis frequently use log-transformed time variables. The proportional hazards model, widely used in medical research and life insurance pricing, includes log terms as a core component. Excel analysts working in these fields use LN to compute hazard ratios, compare survival curves, and estimate policy pricing under various assumptions. The ability to perform these calculations directly in Excel — without specialized statistical software — saves significant time and reduces workflow complexity.
Another practical use case is pH calculation in chemistry. pH is defined as the negative base-10 log of hydrogen ion concentration, but many intermediate calculations in buffer chemistry and equilibrium problems involve natural logarithms through the Nernst equation and thermodynamic relationships. Excel's LN function handles these calculations elegantly, and because Excel also supports LOG10, chemists can switch between natural and common logarithms with ease depending on which formulation their equations require.
In economics and econometrics, the Cobb-Douglas production function, a cornerstone model relating inputs like capital and labor to economic output, is typically linearized by taking natural logs of all variables. Economists running these regressions in Excel use LN to transform raw GDP, capital stock, and employment figures into log-space variables, then apply LINEST or the Analysis ToolPak's regression tool to estimate elasticities. The resulting coefficients directly represent percentage-change relationships, making interpretation intuitive for policymakers and executives.
Finally, the LN function plays a key role in information theory and data compression. The entropy of a probability distribution — a measure of uncertainty or information content — is computed using sums of terms like p × LN(p). While Excel is not the primary tool for information-theoretic work, data analysts building decision tree models or evaluating feature importance sometimes compute entropy metrics directly in spreadsheets as a quick sanity check before moving to more sophisticated environments. The LN function makes this feasible without leaving Excel.
LN vs LOG vs LOG10: How to Merge Understanding of Excel Logarithms
The LN function computes the natural logarithm using base e (approximately 2.71828). Its syntax is simply =LN(number), requiring only one argument. This function is the preferred choice in finance, science, and data analysis whenever the underlying mathematics involves exponential growth or decay governed by Euler's number. Log returns in investing, half-life calculations in chemistry, and entropy in information theory all call for LN specifically — not LOG or LOG10.
A key characteristic of LN is its output range: LN(1) = 0, LN(e) = 1, LN values for numbers greater than 1 are positive, and LN values for numbers between 0 and 1 (exclusive) are negative. This behavior makes LN useful for identifying whether a ratio is above or below 1 — if LN(A2/B2) is negative, the value in A2 is smaller than B2, a pattern analysts exploit in ratio comparison dashboards and variance reports.

Pros and Cons of Using LN in Excel for Data Analysis
- +Instantly linearizes exponential relationships for easier regression and trend analysis
- +One-argument syntax makes formulas clean, readable, and fast to write
- +Compresses right-skewed distributions, improving statistical model performance
- +Perfectly invertible with EXP — round-trip transformations are lossless
- +Integrates seamlessly with SUM, IF, ARRAYFORMULA, and other Excel functions
- +Matches the mathematical convention used in finance, science, and machine learning
- −Returns a #NUM! error for zero or negative inputs — requires preprocessing guards
- −Output is not intuitive to non-technical stakeholders without additional explanation
- −Confused with LOG10 by beginners, leading to subtle but significant calculation errors
- −Long decimal outputs require explicit formatting to look clean in reports
- −Cannot handle complex numbers — Excel's LN is real-valued only
- −No built-in way to apply LN to an entire range at once without dragging or ARRAYFORMULA
Excel LN Function Best-Practice Checklist
- ✓Verify all input values are strictly positive (greater than zero) before applying LN.
- ✓Use =IF(A2>0, LN(A2), "N/A") to handle potential zero or negative values gracefully.
- ✓Add 1 to inputs that might be zero: =LN(A2+1) is a common safe transformation.
- ✓Apply consistent number formatting (4 decimal places) to all LN output columns.
- ✓Document in a cell comment or header note which base your logarithm uses.
- ✓Use EXP(LN(A2)) as a sanity check — the result should exactly equal A2.
- ✓Name your LN-transformed columns clearly, e.g., 'ln_revenue' instead of just 'transformed'.
- ✓Avoid nesting LN inside LOG — combine only complementary functions like EXP or POWER.
- ✓Test your LN formula on known values: LN(1)=0, LN(2.71828)≈1, LN(10)≈2.3026.
- ✓Use IFERROR(LN(A2), 0) as a last resort only — prefer fixing the root data quality issue.
Always verify with EXP(LN(x)) = x
The single most useful check when working with Excel's LN function is to confirm that =EXP(LN(A2)) returns exactly the value in A2. If it does not — due to a formula error, a data type issue, or accidental text formatting — this sanity check will catch the problem immediately before it propagates through downstream calculations. Make this a standard step in any spreadsheet audit involving logarithmic transformations.
Advanced users of Excel frequently nest LN inside larger formula constructions to solve multistep problems in a single cell. One classic example is the continuous compounding formula for calculating the effective annual rate: =EXP(LN(1 + nominal_rate) * periods) - 1. This formula correctly handles quarterly, monthly, or daily compounding and produces the mathematically precise effective rate — far more accurate than simple approximations. Financial analysts building rate comparison tools use exactly this pattern to benchmark different loan products or bond yields side by side.
Another powerful nesting pattern involves combining LN with Excel's SUMPRODUCT function for weighted logarithmic averages. A weighted geometric mean — used in index construction, portfolio performance attribution, and scientific averaging — is computed as EXP(SUMPRODUCT(weights, LN(values)) / SUM(weights)). This single formula replaces what would otherwise require an entire helper column of intermediate LN calculations, keeping your workbook clean and reducing the surface area for errors. It is a technique employed by quants building factor models in Excel before migrating to Python or R.
The LN function also enables log-linear interpolation, a technique for estimating values that grow exponentially between two known data points. Suppose you know a population was 50,000 in 2010 and 80,000 in 2020, and you want to estimate the 2015 value. The formula is: =EXP(LN(50000) + (5/10) * (LN(80000) - LN(50000))), which returns approximately 63,246 — the geometrically correct midpoint, not the arithmetic midpoint of 65,000. This distinction matters whenever the underlying process is multiplicative rather than additive.
For users working with time series data, the LN function is central to computing log-differenced series, which transform non-stationary price or volume data into stationary return data suitable for ARIMA modeling and autocorrelation analysis. In Excel, this looks like =LN(B3/B2) dragged down a column of daily stock prices, producing a series of log returns. The resulting series is far more tractable statistically than raw price changes, and Excel's built-in charting and regression tools work directly on it without any additional software.
One underappreciated application of LN in Excel is entropy and diversity index calculation. Ecologists, economists studying market concentration, and information theorists all use Shannon entropy, defined as the negative sum of p_i × LN(p_i) across all categories or states. In Excel, this becomes =-SUMPRODUCT(A2:A10, LN(A2:A10)), where A2:A10 holds the probability of each category. This one-line formula computes the information entropy of any discrete distribution — an elegant example of LN's power when combined with array-style computation via SUMPRODUCT.
Advanced Excel users also leverage LN in custom growth rate estimation. Given a starting value, an ending value, and a known time span, the implied continuous growth rate is =LN(ending/starting) / years. For instance, if a company's revenue grew from $2 million to $8 million over 7 years, the continuous growth rate is LN(8/2)/7 ≈ 19.8% per year. This metric is more useful than CAGR in many analytical contexts because continuous rates are directly addable across periods and directly comparable across investment vehicles with different compounding conventions.
Finally, LN is a core component of the logistic regression sigmoid function, expressed as 1/(1+EXP(-x)). While Excel is rarely used for full logistic regression, analysts sometimes prototype binary classification models in Excel using LN and EXP to compute log-odds, predicted probabilities, and cross-entropy loss. Understanding this relationship between LN, EXP, and probability modeling helps Excel users bridge the gap between spreadsheet analysis and formal statistical or machine learning tooling, making them more effective collaborators with data science teams.

Excel's LN function is mathematically undefined for inputs of zero or any negative number, and it will return a #NUM! error in those cases. Before applying LN to a column of data, always audit your inputs for zeros or negatives. Wrap the formula in IFERROR or add an IF guard — such as =IF(A2>0, LN(A2), "Invalid") — to prevent errors from cascading through dependent calculations and corrupting your entire model.
One of the most frequent stumbling blocks for beginners is confusing LN with LOG inside complex nested formulas. Because LOG defaults to base 10 when no second argument is supplied, writing =LOG(A2) instead of =LN(A2) produces a result that is off by a factor of LN(10) ≈ 2.3026 — a significant difference that can invalidate an entire analysis. The safest habit is to always explicitly write LN when you need the natural log and never rely on LOG's default behavior, which can mislead colleagues who read your formulas later and assume base 10.
Another common mistake is applying LN to percentage values stored as decimals without accounting for the scaling. If cell A2 contains 0.05 representing a 5% interest rate, then LN(A2) ≈ -3.0, which is the natural log of 0.05 — almost certainly not what you intend. In most financial formulas, you would want LN(1 + A2) ≈ 0.0488, which represents the log of the growth factor. This off-by-one distinction between rate and growth factor is a subtle but critical difference that causes errors in compound interest calculations, option pricing models, and yield curve analysis.
A third source of errors is text-formatted numbers masquerading as numeric values. When data is imported from external systems or copy-pasted from web pages, numbers sometimes arrive as text strings that look like numbers. Excel's LN function will return a #VALUE! error when passed a text string, even if that string contains only digits. To diagnose this, check the cell alignment — text aligns left, numbers align right by default — or use the ISNUMBER function. The fix is to apply VALUE() or multiply by 1 to force numeric conversion before passing to LN.
The floating-point precision of LN results occasionally surprises users who expect perfectly round numbers. LN(e) should theoretically return exactly 1, but because Excel represents e as a finite decimal approximation, the result is 0.9999999999999998 or similar. This is normal floating-point behavior and not a bug in LN. For display purposes, rounding with ROUND(LN(A2), 10) handles this gracefully. However, when using LN results as inputs to conditional logic — such as IF(LN(A2)=1, ...) — you should use approximate comparisons like IF(ABS(LN(A2)-1)<0.0001, ...) to avoid false negatives from rounding noise.
Users sometimes wonder whether Excel's LN is accurate enough for scientific-grade computation. Excel stores numbers using IEEE 754 double-precision floating-point format, providing approximately 15-16 significant decimal digits of precision. Excel's built-in LN implementation is optimized to the full precision of this format, meaning LN results are accurate to about 15 significant figures — more than sufficient for virtually all engineering, financial, and scientific applications short of specialized high-precision numerical computation. You only need to worry about precision when working with numbers extremely close to 1, where catastrophic cancellation can reduce effective precision.
When building spreadsheet models that others will use, consider adding input validation to protect LN cells from receiving invalid inputs. Excel's Data Validation feature (found under the Data tab) lets you restrict a cell to accept only numbers greater than zero, showing a custom error message when invalid data is entered. Combine this with the checklist of defensive formula patterns discussed earlier, and your LN-based models become robust, self-documenting tools that colleagues can use confidently without needing to understand the underlying mathematics.
For those looking to deepen their overall Excel proficiency beyond the LN function, the skills required to handle logarithmic data confidently — understanding function arguments, nesting formulas, error handling, and number formatting — transfer directly to mastering the full breadth of Excel's mathematical and statistical function library. Building a strong foundation in functions like LN, EXP, LOG, POWER, and SQRT equips you to tackle virtually any quantitative challenge that arises in modern data-driven workplaces, from quick ad-hoc calculations to enterprise-scale financial models.
To get the most out of Excel's LN function in your daily workflow, start by building a small personal reference sheet in a dedicated workbook tab. Include a column of test inputs (0.01, 0.1, 0.5, 1, 2, e, 10, 100, 1000), a column of LN results, and a column verifying each result with EXP. This reference sheet serves two purposes: it reinforces your intuition for what LN outputs look like across different magnitudes, and it gives you a ready sanity-check tool when a formula result seems off during real analysis work. Five minutes of setup saves hours of debugging later.
When teaching LN to colleagues or junior analysts, a powerful demonstration is the doubling time formula: the time required for any quantity growing at a constant continuous rate to double is LN(2) / rate ≈ 0.693 / rate. Type =LN(2)/B2 where B2 holds an annual growth rate, and you instantly get the doubling time in years. This is the precise mathematical foundation behind the popular Rule of 70 approximation (divide 70 by the percentage growth rate). Showing colleagues that Excel derives this exactly — not approximately — from the LN function makes a memorable and motivating lesson.
For anyone preparing for the Microsoft Office Specialist (MOS) Excel certification or similar credentials, the LN function appears in the Math and Trig function category that certification exams frequently test. You are likely to encounter scenario questions asking you to apply LN within a nested formula, handle its error outputs, or distinguish it from LOG. Practicing these scenarios through dedicated Excel function quizzes significantly improves both exam performance and real-world readiness. The best preparation combines reading documentation with hands-on practice on realistic datasets.
Consider exploring the combination of LN with Excel's charting tools as a way to visualize logarithmic relationships directly. If you plot a raw exponential dataset, the curve is difficult to interpret. Plot the LN-transformed values instead, and the result is a straight line whose slope directly represents the growth rate.
To add a log-scale axis in Excel charts, right-click the value axis, select Format Axis, and check the Logarithmic Scale option. For base-e scaling specifically, you can transform the data with LN before plotting on a linear axis, giving you full control over tick marks and labels that Excel's built-in log axis does not provide.
Power users working with very large datasets should be aware of Excel's dynamic array functions introduced in Excel 365 and Excel 2019. You can apply LN to an entire range and spill the results into adjacent cells using =LN(A2:A1001) entered as a single formula in cell B2. Excel automatically fills B2 through B1001 with the corresponding LN values, without needing to drag the fill handle. This spill behavior is especially valuable when your input data changes size frequently, as the output range automatically resizes to match. Combine with FILTER or SORT before passing to LN for sophisticated data pipeline patterns.
Finally, consider the role of the LN function in building financial dashboards. Log-scale visualizations of stock prices, revenue growth, or user acquisition curves tell a fundamentally different story than linear charts: equal vertical distances represent equal percentage changes rather than equal absolute changes, making long-term exponential growth far clearer. By computing LN-transformed series in dedicated columns and charting those, you create presentations that communicate compounding growth to executives and investors in an intuitive and mathematically honest way — a skill that distinguishes technically fluent analysts from those who merely know how to click through Excel's wizard interfaces.
The LN function may appear deceptively simple — just one argument, one result — but its applications span the full breadth of quantitative work that modern professionals perform in Excel. From basic scientific calculations to sophisticated financial models, from data preprocessing to visualization, mastering LN gives you a tool that pays dividends every time you encounter exponential phenomena, which is to say, everywhere data describes the real world of growth, decay, and change over time.
Excel Questions and Answers
About the Author

Business Consultant & Professional Certification Advisor
Wharton School, University of PennsylvaniaKatherine Lee earned her MBA from the Wharton School at the University of Pennsylvania and holds CPA, PHR, and PMP certifications. With a background spanning corporate finance, human resources, and project management, she has coached professionals preparing for CPA, CMA, PHR/SPHR, PMP, and financial services licensing exams.




