How to use the LOG10 function
What is the LOG10 function?
The LOG10 function calculates the logarithm of a number using the base 10.
Table of Contents
1. Introduction
What is a logarithm?
In logarithms, the base is the number that is raised to a power to produce the desired output. It is the foundation of the logarithmic function.
What is the log10?
The logarithm base 10, or log10, also known as the common logarithm, is the special case where the base is 10:
log10(x) = y where x and y are numbers such that 10^y = x
In other words, log10(x) is the power that 10 must be raised to in order to equal x.
What is the definition of a logarithm with an base of 10?
For the base 10:
log10(x) = lim (n->infinity) (x^(1/n) - 1) * n / log10(e)
Where:
-
- 10 is the base
- x is the input number
- e is the mathematical constant (approximately 2.71828...)
This limit definition comes from Euler's Logarithm Definition, relating logs of any base b to the natural log ln(x).
What is a base?
In logarithms, the base is the number that is raised to a power to produce the desired output. It is the foundation of the logarithmic function.
For example, the logarithm log10(100):
- 10 is the base
- 100 is the input number
- 2 is the exponent that makes 10 return 100 because 102 = 100
The most common bases are
- 10
- e (natural log), and
- 2 (for computers).
But any positive number besides 1 can be a base.
What are the four key logarithm rules?
The following rules are essential to learn if you want to solve various equations involving natural logarithms effectively.
- Product rule
log10(x*y) = log10(x) + log10(y)
The log10 of the multiplication of x and y is the sum of the log10 x and log10 y.
Example, log10(5*10) = log10(5) + log10(10) - Quotient rule
log10(x/y) = log10(x) - log10(y)
The log10 of the division of x and y is the difference of the log10 x and log10 y.
Example, log10(5/10) = log10(5) - log10(10) - Reciprocal rule
log10(1/x) = − log10(x)
The natural log of the reciprocal of x is similar to the quotient rule. log10(1/x) = log10(1) - log10(x) = 0 - log10 x = - log10 x
Example, log10(1/5) = - log10(5) - Power rule
log10(xy) = y * log10(x)
The log10 of x raised to the power of y is y multiplied by the log10 x.
Example, log10(510) = 10 * log10(5)
What are the other logarithmic functions in Excel?
Excel function | Description |
---|---|
LOG | Returns the logarithm with a given base. |
LN | Returns the natural logarithm (base e) of a number |
LOG10 | Returns the base-10 logarithm of a number |
LOG2 | Returns the base-2 logarithm of a number |
The corresponding inverse functions for the logarithm functions in Excel:
Logarithm | Power to |
---|---|
LOG | Arbitrary base, basex or POWER(number, power) |
LN | EXP(number) |
LOG10 | 10x or POWER(10,x) |
LOG2 | 2x or POWER(2,x) |
2. Syntax
LOG10(number)
number | Required. A value larger than 0 (zero) that you want to calculate the logarithm with base 10. |
3. Example 1
This example demonstrates how to use the log10 function, the image above shows a chart with different logarithmic bases. Below the chart is a table containing numbers (B25:B29) and next to the numbers are the log10 calculations in cell range D25:D29.
log10(x) = y where x and y are numbers so that 10y = x
The first number in cell B25 is 1. The output from the log10 function is 0 (zero).
Formula in cell C25:
If we calculate 100 we get 1. This matches the number in cell B25. To calculate 10 to the power of 0 (zero) in Excel we can use the caret character ^, here is how: =10^0 This will calculate 10 to the power of 0 (zero) in an Excel formula. We can also use the POWER function: =POWER(number, power) For example, POWER(10,0) which returns 1.
We can also use the chart to verify the values. Find 1 on the x-axis, follow an imaginary vertical line up until you intersect the log10 curve. In this case, it is exactly 0 (zero) on the y-axis located on the left side of the chart.
The second number is in cell B26 and it is 10.
Formula in cell C26:
The output from the log10 function is 1. If we calculate 101 we get 10. This matches the number in cell B26.
We can also use the chart to verify the values. Find 10 on the x-axis, follow an imaginary vertical line up until you intersect the log10 curve. Then follow an imaginary horizontal line to the left until you reach the y-axis. In this case, it is exactly 1 on the y-axis located on the left side of the chart.
The third number is in cell B27 and it is 100.
Formula in cell C27:
The output from the log10 function is 2. If we calculate 102 we get 100. This matches the number in cell B27.
The fourth number is in cell B28 and it is 45.
Formula in cell C28:
The output from the log10 function is approx. 1.653. If we calculate 101.65321251377534 we get 45. This matches the number in cell B28.
The fourth number is in cell B29 and it is 33.
Formula in cell C28:
The output from the log10 function is approx. 1.5185. If we calculate 101.51851393987789 we get 33. This matches the number in cell B28.
4. Example 2
An initial seismic event registered a magnitude of 4.0 on the Richter scale. A subsequent earthquake was 900 times greater than the initial event. Given that the Richter scale is logarithmic (base 10) and that each whole number increase represents a 10-fold increase in ground motion amplitude , determine the Richter magnitude of the second, more powerful earthquake?
Formula in cell D23:
LOG10(900) evaluates to approx 2.9542, add 4 to this number and we get the magnitude for the subsequent earthquake which is approx. 6.9542
The image shows a graph representing the Richter scale for measuring earthquake intensity. The x-axis represents the Richter scale magnitude, ranging from 1 to 10. The y-axis shows a logarithmic scale for seismic amplitude, ranging from 1 to 10^10 (10 billion). The scale is logarithmic, meaning each major grid line represents a 10-fold increase. The blue dots connected by lines show the exponential relationship between Richter magnitude and seismic amplitude.
A green horizontal line is drawn at around the 10,000 level on the y-axis, corresponding to a magnitude of approximately 4 on the Richter scale (labeled as the "First earth quake" with a value of 4).
A red vertical line extends from around magnitude 6.9 on the x-axis up to the curve, then horizontally to the y-axis, intersecting at about 9,000,000 on the logarithmic scale.
5. Function not working
The LOG10 function returns
- #NUM! error if number is equal to 0 (zero) or smaller.
- #VALUE! error if you use a non-numeric input value.
- #NAME? error if you misspell the function name.
- propagates errors, meaning that if the input contains an error (e.g., #VALUE!, #REF!), the function will return the same error.
5.1 Troubleshooting the error value
When you encounter an error value in a cell a warning symbol appears, displayed in the image above. Press with mouse on it to see a pop-up menu that lets you get more information about the error.
- The first line describes the error if you press with left mouse button on it.
- The second line opens a pane that explains the error in greater detail.
- The third line takes you to the "Evaluate Formula" tool, a dialog box appears allowing you to examine the formula in greater detail.
- This line lets you ignore the error value meaning the warning icon disappears, however, the error is still in the cell.
- The fifth line lets you edit the formula in the Formula bar.
- The sixth line opens the Excel settings so you can adjust the Error Checking Options.
Here are a few of the most common Excel errors you may encounter.
#NULL error - This error occurs most often if you by mistake use a space character in a formula where it shouldn't be. Excel interprets a space character as an intersection operator. If the ranges don't intersect an #NULL error is returned. The #NULL! error occurs when a formula attempts to calculate the intersection of two ranges that do not actually intersect. This can happen when the wrong range operator is used in the formula, or when the intersection operator (represented by a space character) is used between two ranges that do not overlap. To fix this error double check that the ranges referenced in the formula that use the intersection operator actually have cells in common.
#SPILL error - The #SPILL! error occurs only in version Excel 365 and is caused by a dynamic array being to large, meaning there are cells below and/or to the right that are not empty. This prevents the dynamic array formula expanding into new empty cells.
#DIV/0 error - This error happens if you try to divide a number by 0 (zero) or a value that equates to zero which is not possible mathematically.
#VALUE error - The #VALUE error occurs when a formula has a value that is of the wrong data type. Such as text where a number is expected or when dates are evaluated as text.
#REF error - The #REF error happens when a cell reference is invalid. This can happen if a cell is deleted that is referenced by a formula.
#NAME error - The #NAME error happens if you misspelled a function or a named range.
#NUM error - The #NUM error shows up when you try to use invalid numeric values in formulas, like square root of a negative number.
#N/A error - The #N/A error happens when a value is not available for a formula or found in a given cell range, for example in the VLOOKUP or MATCH functions.
#GETTING_DATA error - The #GETTING_DATA error shows while external sources are loading, this can indicate a delay in fetching the data or that the external source is unavailable right now.
5.2 The formula returns an unexpected value
To understand why a formula returns an unexpected value we need to examine the calculations steps in detail. Luckily, Excel has a tool that is really handy in these situations. Here is how to troubleshoot a formula:
- Select the cell containing the formula you want to examine in detail.
- Go to tab “Formulas” on the ribbon.
- Press with left mouse button on "Evaluate Formula" button. A dialog box appears.
The formula appears in a white field inside the dialog box. Underlined expressions are calculations being processed in the next step. The italicized expression is the most recent result. The buttons at the bottom of the dialog box allows you to evaluate the formula in smaller calculations which you control. - Press with left mouse button on the "Evaluate" button located at the bottom of the dialog box to process the underlined expression.
- Repeat pressing the "Evaluate" button until you have seen all calculations step by step. This allows you to examine the formula in greater detail and hopefully find the culprit.
- Press "Close" button to dismiss the dialog box.
There is also another way to debug formulas using the function key F9. F9 is especially useful if you have a feeling that a specific part of the formula is the issue, this makes it faster than the "Evaluate Formula" tool since you don't need to go through all calculations to find the issue..
- Enter Edit mode: Double-press with left mouse button on the cell or press F2 to enter Edit mode for the formula.
- Select part of the formula: Highlight the specific part of the formula you want to evaluate. You can select and evaluate any part of the formula that could work as a standalone formula.
- Press F9: This will calculate and display the result of just that selected portion.
- Evaluate step-by-step: You can select and evaluate different parts of the formula to see intermediate results.
- Check for errors: This allows you to pinpoint which part of a complex formula may be causing an error.
The image above shows cell reference B25 converted to hard-coded value using the F9 key. The LOG10 function requires numerical values larger than 0 (zero) which is not the case in this example. We have found what is wrong with the formula.
Tips!
- View actual values: Selecting a cell reference and pressing F9 will show the actual values in those cells.
- Exit safely: Press Esc to exit Edit mode without changing the formula. Don't press Enter, as that would replace the formula part with the calculated value.
- Full recalculation: Pressing F9 outside of Edit mode will recalculate all formulas in the workbook.
Remember to be careful not to accidentally overwrite parts of your formula when using F9. Always exit with Esc rather than Enter to preserve the original formula. However, if you make a mistake overwriting the formula it is not the end of the world. You can “undo” the action by pressing keyboard shortcut keys CTRL + z or pressing the “Undo” button
5.3 Other errors
Floating-point arithmetic may give inaccurate results in Excel - Article
Floating-point errors are usually very small, often beyond the 15th decimal place, and in most cases don't affect calculations significantly.
6. How to raise a number to the power of
The POWER function lets you raise a number to the power of a specific value. For example, =POWER(10,2) is the same as 102 equals 100.
The caret character lets you also raise a number to the power of a specific value, it is smaller than the POWER function which then makes your formulas smaller. For example, =10^2 is the same as =POWER(10,2) or 102 which equals 100.
'' function examples
The following article has a formula that contains the function.
I will in this article demonstrate three different techniques to sort a data set in Excel. The first method sorts […]
Functions in 'Math and trigonometry' category
The LOG10 function function is one of 62 functions in the 'Math and trigonometry' category.
How to comment
How to add a formula to your comment
<code>Insert your formula here.</code>
Convert less than and larger than signs
Use html character entities instead of less than and larger than signs.
< becomes < and > becomes >
How to add VBA code to your comment
[vb 1="vbnet" language=","]
Put your VBA code here.
[/vb]
How to add a picture to your comment:
Upload picture to postimage.org or imgur
Paste image link to your comment.
Contact Oscar
You can contact me through this contact form