# LOG Function in Excel

Part 1: Introduce

๐ LOG Function in Microsoft Excel

• Definition: The LOG function in Microsoft Excel returns a number’s logarithm to a base you specify.

• Purpose: To compute the logarithm of a given number based on a specific base.

• Syntax & Arguments:

syntax
`LOG(number, [base]) `
• Number: Required. The positive actual number for which you want the logarithm.
• Base: Optional. The base of the logarithm. If the base is omitted, it is assumed to be 10.
• Return value: The LOG function returns the power to which the base must be raised to equal the number.

• Remarks: If the base is not provided, the function assumes it to be 10.

Part 2: Examples

๐ Example 1

• Purpose: To find the logarithm of 10.

• Data sheet and formulas:

ABC
1NumberFormulaResult
210=LOG(A2)1
• Explanation: The logarithm of 10 with the base assumed to be 10 is 1.

๐ Example 2

• Purpose: To find the logarithm of 8 with base 2.

• Data sheet and formulas:

ABCD
1NumberBaseFormulaResult
282=LOG(A2, B2)3
• Explanation: The logarithm of 8 with base 2 is 3.

๐ Example 3

• Purpose: To find the logarithm of 86 with base e (approximately 2.718).

• Data sheet and formulas:

ABCD
1NumberBaseFormulaResult
2862.7182818=LOG(A2, B2)4.4543473
• Explanation: The logarithm of 86 with base e (approximately 2.718) is approximately 4.454.

๐ Example 4

• Purpose: To find the logarithm of 100.

• Data sheet and formulas:

ABC
1NumberFormulaResult
2100=LOG(A2)2
• Explanation: The logarithm of 100 with the base assumed to be 10 is 2.

๐ Example 5

• Purpose: To find the logarithm of 64 with base 2.

• Data sheet and formulas:

ABCD
1NumberBaseFormulaResult
2642=LOG(A2, B2)6
• Explanation: The logarithm of 64 with base 2 is 6.

๐ Example 6: Using LOG with IF

• Purpose: To find the logarithm of a number but return an error message if the number is negative.

• Data sheet and formulas:

ABC
1NumberFormulaResult
210=IF(A2>0, LOG(A2), “Error: Negative No.”)1
3-5=IF(A3>0, LOG(A3), “Error: Negative No.”)Error: Negative No.
• Explanation: The formula checks if the number is positive. If it is, it returns the logarithm. If not, it returns an error message. This is useful to prevent mathematical errors when dealing with logarithms, as they’re undefined for negative numbers.

๐ Example 7: Using LOG with SUM

• Purpose: To find the sum of the logarithms of two numbers.

• Data sheet and formulas:

ABCD
1Number1Number2FormulaResult
210100=SUM(LOG(A2), LOG(B2))3
• Explanation: The formula calculates the logarithm for each number and then sums them up. This can be useful in scenarios where you need to aggregate logarithmic values.

๐ Example 8: Using LOG with VLOOKUP

• Purpose: To find the logarithm of a number based on a lookup value.

• Data sheet and formulas:

ABCD
1Lookup ValNumberFormulaResult
2Value110=LOG(VLOOKUP(“Value1”, A2:B3, 2, FALSE))1
3Value2100
• Explanation: The formula uses VLOOKUP to find the number associated with “Value1” and then calculates its logarithm. This is useful when you have a table of values and want to compute the logarithm based on a specific lookup value.

๐ Example 9: Using LOG with AVERAGE

• Purpose: To find the average logarithm of a range of numbers.

• Data sheet and formulas:

ABC
1NumberFormulaResult
210=AVERAGE(LOG(A2), LOG(A3))1.5
3100
• Explanation: The formula calculates the logarithm for each number in the range and then finds their average. This can be useful in statistical analyses where you want to see the central tendency of logarithmic values.

๐ Example 10: Using LOG with MAX

• Purpose: To find the maximum logarithm value from a range of numbers.

• Data sheet and formulas:

ABC
1NumberFormulaResult
210=MAX(LOG(A2), LOG(A3))2
3100
• Explanation: The formula calculates the logarithm for each number in the range and then finds the maximum value. This can be useful when determining the highest logarithmic value from a data set.

๐ Example 11: Using LOG with MIN

• Purpose: To find the minimum logarithm value from a range of numbers.

• Data sheet and formulas:

ABC
1NumberFormulaResult
210=MIN(LOG(A2), LOG(A3))1
3100
• Explanation: Similar to the previous example, this formula calculates the logarithm for each number in the range and then finds the minimum value.

๐ Example 12: Using LOG with ROUND

• Purpose: To find the logarithm of a number and round it to two decimal places.

• Data sheet and formulas:

ABC
1NumberFormulaResult
286=ROUND(LOG(A2), 2)1.93
• Explanation: The formula calculates the logarithm of the number and then rounds it to two decimal places. This is useful when presenting logarithmic values in a more readable format, especially in financial or business reports where precision is key.

Part 3: Tips and Tricks

1. Always ensure the number you’re trying to find the logarithm for is positive.
2. If you’re unsure about the base, remember that the default is 10.
3. The LOG function can benefit financial and scientific calculations using logarithmic scales.
4. If you want to compute the natural logarithm (base e), consider using the LN function in Excel.
5. Experiment with different bases to understand the relationship between numbers and their logarithms.