Excel Log Functions: How to Use LOG, LOG10, and LN

Formulas & functions · Updated November 22, 2026

To integrate logarithm functions into an Excel worksheet, enter LOG, LOG10, or LN in a cell formula, point the function at a positive numeric value, and fill the formula down for the rest of your data. Use LOG for a chosen base, LOG10 for base 10, and LN for the natural logarithm. This guide uses Excel for Microsoft 365 on Windows and shows how to choose the function, build formulas, and deal with common errors.

What You’ll Need

  • Excel for Microsoft 365 on Windows. The functions covered here also work in many earlier Excel versions.
  • A worksheet containing numeric values greater than zero. Logarithms of zero or negative numbers are not defined in the real-number system Excel uses.
  • A blank column for your results, plus a clear idea of which logarithm base your analysis requires.

Step-by-Step

  1. Check the data and choose where results will go. Put the values you want to transform in one column and leave the next column for the calculated logarithms. For example, enter 100, 1,000, and 10,000 in A2:A4, then use column B for results. Check that the source values are actual numbers, not labels or error values. Each input must be greater than zero; a blank cell or a value such as -5 cannot produce a real logarithm. Add a heading such as “Base-10 log” in B1 so that anyone reading the sheet knows what the results mean.
  2. Use LOG for a chosen base. LOG returns the logarithm of a number for a base you specify. With the values 100, 1,000, and 10,000 in A2:A4, enter this in B2 to calculate the base-10 logarithm of the first value: =LOG(A2,10). The result is 2, because 10 raised to the power 2 equals 100. The optional base argument can be omitted when you want base 10, but including it makes the intended base explicit. In Excel’s function syntax, the number comes first and the base comes second.
  3. Use LOG10 when the base is definitely 10. LOG10 is a dedicated function for common logarithms, meaning logarithms with base 10. With 100 in A2, enter this in B2: =LOG10(A2). The result is 2. For the example values 100, 1,000, and 10,000, the results are 2, 3, and 4. Choose LOG10 when you want the formula to state clearly that the calculation uses base 10. If you need a different base later, switch to LOG and supply that base instead.
  4. Use LN for the natural logarithm. LN calculates a logarithm with base e, a mathematical constant approximately equal to 2.71828. It is common in statistics, science, and calculations involving continuous growth. With 100 in A2, enter this in B2: =LN(A2). Excel returns approximately 4.605170186. This is not the same result as the base-10 logarithm of 100, which is 2. Use LN only when the method, instructions, or model calls for the natural logarithm; do not substitute it for LOG10 just because both functions are logarithms.
  5. Calculate a different base when needed. LOG lets you choose a base other than 10 or e. For example, with 8 in A2, calculate its base-2 logarithm in B2 using: =LOG(A2,2). The result is 3, because 2 raised to the power 3 equals 8. This is useful for problems involving powers of two, such as counting repeated halvings or working with binary scales. The base must be positive and cannot equal 1. If you are following a formula from a textbook or report, confirm its base before entering the Excel formula.
  6. Apply the calculation to the remaining rows. After entering a formula in B2, select that cell and drag the small square at its lower-right corner down through the other data rows. Excel adjusts the relative reference, so the formula in B3 refers to A3, and so on. You can also copy B2, select the destination cells, and paste. Check the first and last results against hand-calculated or expected values before relying on a long column. For the base-10 example, the sequence 100, 1,000, 10,000 should produce 2, 3, 4.
  7. Combine logarithms with other worksheet calculations where appropriate. A logarithm can transform a ratio as well as a single measurement. Suppose A2 contains a starting measurement of 5 and B2 contains a later measurement of 20. To calculate the base-10 logarithm of the later value divided by the starting value, enter this in C2: =LOG10(B2/A2). The ratio is 4, and the result is approximately 0.60206. This is not the same as subtracting the two original values. Use a ratio-based formula only when that transformation matches the question you are trying to answer.
  8. Label, format, and verify the results. Give the output column a useful heading that includes the base or function, such as “LN(value)” or “Log base 2.” Logarithm results are often decimals, so set an appropriate number of displayed decimal places using Home > Number. Formatting changes how many digits are shown, not the underlying result. Click a result cell and inspect the formula bar to confirm it references the intended input and uses the right function. Keep the original values in the worksheet so you can trace and review the transformation.

Common Mistakes

Using the wrong base. LOG10 and LN do different calculations, even when they refer to the same input. A base-10 logarithm of 100 is 2, while its natural logarithm is about 4.60517. Read the instructions for your analysis and label the result column so the base is not mistaken later.

Entering zero or a negative number. LOG, LOG10, and LN return an error for these inputs. A value of zero does not have a finite logarithm, and negative inputs are outside the real-valued logarithms these Excel functions calculate. Do not change a value just to remove an error; first check whether the source data or the chosen method is wrong.

Reversing the arguments in LOG. The first argument is the number being transformed and the second is the base. A formula with those positions reversed may still return a number, but it answers a different question. Test a simple known value, such as 8 with base 2, when checking your argument order.

Using a base that is invalid. A valid real-number logarithm base must be greater than zero and different from 1. A base of 1 is invalid because every power of 1 is still 1, so it cannot produce other input values. Check a base stored in a cell just as carefully as the values being transformed.

Confusing displayed values with stored values. A cell formatted to show two decimal places can display 4.61 even though the stored value is 4.605170186. If a later calculation appears slightly different from a calculation using the visible digits, check the cell’s full value in the formula bar and its number format.

Tips

  • Use LOG10 or LN when the base is fixed; use LOG when the base is part of the calculation or may change.
  • Put a changeable base in a clearly labeled cell if you want to compare results across bases. Make sure the base cell remains fixed when copying formulas by using an absolute reference such as $C$1.
  • Keep raw data and transformed data in separate columns. This makes it easier to audit the calculation and reuse the original measurements.
  • Do not round the formula result unless the task requires rounded values. Set the displayed decimal places for readability while preserving precision in the cell.
  • Excel for the web supports these standard logarithm functions. On Mac, the functions work as well; ribbon layout and shortcuts can differ. On Windows, Ctrl+C and Ctrl+V copy and paste; on Mac, use Command+C and Command+V.
  • If your regional settings use semicolons as formula separators, Excel may display or require semicolons instead of commas. The examples here use the standard comma-separated syntax.

Troubleshooting

If you see #NUM!: Inspect the number and, for LOG, the base. The number must be greater than zero. The base must also be greater than zero and cannot be 1. If the values come from formulas, trace those source formulas to find where a zero, negative number, or invalid base entered the calculation.

If you see #VALUE!: Check whether the input cell contains text that Excel cannot use as a number, such as a word, an unexpected symbol, or a number stored with an incompatible format. Correct the source data rather than hiding the error. Also make sure the formula refers to the intended cells and has the correct arguments.

If the formula appears in the cell instead of a result: The cell may be formatted as Text, or Show Formulas may be enabled. Change the cell format to General, then re-enter the formula by pressing F2 and Enter. In Excel for Windows, Ctrl+` toggles Show Formulas; on Mac, the shortcut can vary by keyboard and Excel settings, so check the Formulas tab’s Show Formulas control if needed.

If copied formulas show incorrect results: Select a few cells in the output column and inspect their references. A relative reference should move with each row. If the same base is stored in a cell and the reference changes as you fill down, lock it with dollar signs before copying. Also verify that the first formula starts in the same row as the first input value.

If the result seems wrong but there is no error: Test the function with a small value whose logarithm you know, and confirm the selected base. For example, a base-2 logarithm of 8 should be 3. Check whether you intended to take the logarithm of a ratio, a product, or one individual value; changing what is inside the function changes the meaning of the calculation.

Frequently Asked Questions

What is the difference between LOG, LOG10, and LN?
LOG can use a base you provide and defaults to base 10 if you omit it. LOG10 always uses base 10. LN always uses base e, the natural logarithm base.

Can I calculate a logarithm with any base in Excel?
Yes. Use LOG with the value first and the base second. The value and base must both be positive, and the base cannot equal 1. If the desired base is 10, LOG10 is also available; for base e, use LN.

Why does Excel return an error for a negative input?
Excel’s standard LOG, LOG10, and LN functions calculate real-valued logarithms, which are not defined for negative inputs. Check whether the input is valid for your analysis and whether the source data has been entered correctly.

How do I fill a logarithm formula down a column?
Enter the formula beside the first data value, select its cell, and drag the fill handle down. Excel updates relative references for each row. Review the resulting references and test a few values before using the full column.

Can I use logarithms in a chart or a larger formula?
Yes. You can reference a cell containing a logarithm result in another calculation or chart, provided the transformed values fit the analysis. Keep the original measurements available, label the transformed series clearly, and make sure the chart or model calls for that logarithm base.

Related

Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.

More in Formulas & functions

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.