LOG Function in Excel & Sheets
Master the LOG function for logarithmic calculations with any base. Learn to analyze exponential growth and solve complex equations in Excel & Sheets.
=LOG(number, [base])Quick Answer
LOG function LOG function is a mathematical function in Excel and Google Sheets that calculates the logarithm of a number to a specified base. It returns the power to which the base must be raised to produce the given number. The basic syntax is `=LOG(number, [base])` where number is the positive value you want to find the logarithm of, and base is optional (defaults to 10).
=LOG(number, [base])Practical Examples
Basic Logarithm Calculation
Calculate the common logarithm (base 10) of a number
Custom Base Logarithm
Calculate logarithms with different bases for specialized applications
pH Level Calculation
Calculate pH from hydrogen ion concentration using logarithms
Compound Interest Time Calculation
Determine time needed to reach an investment goal with compound interest
Decibel Level Calculation
Convert sound intensity ratios to decibels using logarithms
Common Errors and Solutions
LOG cannot process the input values
The number argument is zero, negative, or the base is invalid (≤0 or =1)
1. Verify the number is positive (>0) 2. Check base is positive and not equal to 1 3. Use ABS() for absolute values if needed 4. Add data validation to prevent invalid inputs
Always validate that input values are positive before using LOG
LOG receives non-numeric arguments
One or both arguments contain text or other non-numeric values
1. Check for hidden spaces or text characters 2. Use VALUE() to convert text to numbers 3. Verify cell references are correct 4. Remove any formatting characters like currency symbols
Use ISNUMBER() to validate inputs before processing
Division by zero in LOG calculations
Using LOG result in division when the result is zero (LOG(1) = 0)
1. Check if LOG result equals zero before division 2. Use IF statement to handle LOG(1) cases 3. Add error handling with IFERROR 4. Consider using a different mathematical approach
Always check for LOG(1) = 0 cases when using results in division
Advanced Tips and Techniques
Change of Base Formula
Convert between different logarithm bases using the formula: LOG(x,b) = LN(x)/LN(b). This is useful when you need natural logarithms but want to use LOG.
Logarithmic Scaling for Charts
Use LOG to transform data for logarithmic scale charts, making exponential trends appear linear and easier to analyze.
Precision Limitations
Remember that LOG calculations may have rounding errors with very large or very small numbers. Use ROUND() for consistent decimal places.
Natural Logarithm Alternative
For base-e logarithms (natural logarithm), use the LN function instead of LOG(number, EXP(1)) for better performance and clarity.
Input Validation
Always validate that inputs are positive using data validation rules or IF statements to prevent #NUM! errors in production spreadsheets.
Need Help with LOG Function in Excel & Sheets?
Stop struggling with formula syntax. Use AskFormulas to generate validated formulas instantly with our AI-powered tool.
Example Excel formula:
Related Formulas
The EXP function calculates e raised to the power of a given number for exponential growth, compound interest, and scientific modeling.
The POWER function raises a number to a specified power. Calculate exponentials, compound interest, and growth rates with this essential math function.
Master the ROUND function to round numbers to specified decimal places with practical examples and error solutions for Excel and Google Sheets.
The SQRT function calculates the square root of a positive number in Excel and Google Sheets. Returns the principal square root for mathematical calculations.