LOG Excel Function

LOG function in excel is used to calculate the logarithm of a given number but the catch is that the base for the number is to be provided by the user itself, it is an inbuilt function which can be accessed from the formula tab in excel and it takes two arguments one is for the number and another is for the base.

LOG In Excel

LOG function in Excel computes the logarithm of a number to the base that we specify. LOG in Excel is categorized as a Math/Trigonometry function in Excel. LOG in Excel always returns a numeric value.

In mathematics, the logarithm is the opposite of the exponentiation. It means the logarithmic value of any given number is the exponent to which the base must be raised to produce that number. For example,

25 = 32

For a given number 32, 5 is the exponent to which base 2 has been raised to produce the number 32. So, a LOG of 32 will be 5.

Mathematically, we write it as log­232 =5, which is a LOG of 32 to the base 2 is 5.

LOG Formula in Excel

LOG Formula

Number:  is a positive real number (should not be a 0) for which we want to calculate logarithm in excel

Base: it is an optional argument, it is the base on which the logarithmic value is calculated, and the LOG function in Excel by default takes the base as 10.

How to Use the LOG Function in Excel?

LOG in Excel is very simple and easy to use. Let us understand the working of the LOG function in Excel by some LOG Formula examples.

You can download this LOG Function Excel Template here – LOG Function Excel Template
Logarithmic function
Logarithmic function 1

The Logarithmic function is used for mathematical operations and is widely used in financial statisticsWidely Used In Financial StatisticsStatistics is the science behind identifying, collecting, organizing and summarizing, analyzing, interpreting, and finally, presenting such data, either qualitative or quantitative, which helps make better and effective decisions with relevance.read more. In business analytics, LOG in Excel is often used with other tools for regression analysis and plotting graphs for data representation. Logarithmic functions are used for graphical representation when the rate of change in the data increases or decreases quickly.

The POWER function returns the result of a number raised to a power, so inversely, the LOG function in Excel returns the Power (exponent) to which the base is raised.

LOG in Excel Example #1

For example, 45 = 1024, using the POWER functionPOWER FunctionPOWER function calculates the power of a given number or base. To use this function you can use the keyword =POWER( in a cell and provide two arguments one as number and another as power.read more, we would write it as POWER(4,5) = 1024 now; if we nest this formula of POWER function inside the log function in Excel providing the base as 4, we will get the exponent which is passed as a second argument in the POWER function.

LOG POWER Function

The output of the POWER function is passed as the first argument to the LOG function in Excel, and it further computes the result.

LOG in Excel can be used in many ways; Logarithm helps to solve real-world problems. For example, the magnitude of an Earthquake is calculated as the logarithm of the amplitude of the seismic waves generated.

The Magnitude of an Earthquake is represented by a LOG formula:

R=log10(A/A0)

Where A is the measurement of the amplitude earthquake wave and A0 is the smallest amplitude recorded of seismic activity, so if we have the values of A and A0, we can easily calculate the magnitude of the Earthquake in Excel by the LOG formula:

=LOG((A/A0),10)

LOG in Excel Example #2

Suppose we have samples of solutions labeled with alphabets A, B, C….L. We are provided with the [H+] ion concentration in µ mol/liter in the Excel sheet in Column B, and we want to find which solution is acidic, alkaline, or water. The Data table is given below:

LOG Example 2

The acidic and the basic nature of a chemical solution are measured by its pH value, which is calculated by the formula:

pH=-log10[H+]

If pH is less than 7, it is an acidic solution; if a pH is greater than 7, it is a basic(alkaline) solution, and when pH is 7, it is neutral that neither acidic nor basic, like water.

So, to find the acidic and basic nature of the solution, we will use the LOG in Excel and will check if the logarithmic value is less than, greater than, or equal to 7.

Since the given hydrogen concentration is in a unit of µmol/liter. Hence, the value will be X*10-6

So, the LOG in excel to find the nature of the solution.

=IF(-(LOG(B4*POWER(10,-6),10))<7,”Acidic”,IF(-(LOG(B4*POWER(10,-6),10))>7,”Alkaline”,”Water”))+

Computing the value of Log of [H+] concentration * Power(10,-6) since the unit used is µmol/liter and checking, using the IF function if the value is greater than, less than, or equal to 7.

Using the formula in other cells we have,

LOG Example 2--1

Output:

LOG Example 2-3
LOG Example 2-4

The solution labeled with I has the pH value equal to 7; hence it is pure water.

LOG in Excel Example #3

In computer science, every algorithm has its efficiency measured in terms of how fast it fetches the result or gives an output. This efficiency is calculated technically by the time complexity. Time complexity describes the amount of time an algorithm will take to execute.

There are different algorithms for searching an item in a list of an array, for example, Bubble sort, Quick sort, Merge sort, Binary Sort, etc. Every algorithm has different efficiency in terms of its time complexity.

To understand, consider an example,

we have a sorted array,

LOG Function (Array)

Now, we want to search the number 18, from the array of the given number.Array Pointer

This algorithm follows the divide and rule methodology, where it divides the set equally at each step of iteration and searches for the item. When it finds the item, the loops (iteration) gets terminated and returns the value.

Step 1:

log array step 1

Step 2:

log array step 2

 Step 3:

log array step 3

 Step 4:

log array step 4

Number 18 was found at position 9, and it took 4 steps to search the item using the binary search algorithm.

So, the complexity of the Binary search is calculated as log2N, where n is the number of items.

=LOG(16,2) = 4

LOG Array

Hence, to search for an item in an array of items, the binary search will take log2N steps.
Suppose we are provided with a list that contains the total number of items, and to search an item from these items, we are using the Binary search algorithm. Now, we have to find how many steps it will take to find an item from the given items.

LOG Example 3

Again, we will use the LOG in Excel to calculate the complexity.

The LOG formula will be: = ROUND(LOG(A6,2),0)

The result could be in decimal so, we have rounded the result of 0 places of digits.

Concatenating with the “String Steps Required are” we have

=”Steps Required are”&” “&ROUND(LOG(A6,2),0)

LOG Example 3-1

To search for an item from an array of 1000000 items, the binary search will take only 20 steps only.

LOG functions are also widely used in economics for stock price indexing graphs, and these graphs are very useful to check the prices going down or up.

Recommended Articles

This has been a guide to LOG in Excel. Here we discuss the LOG Formula in Excel and how to use the LOG function in Excel along with LOG examples and downloadable excel templates. You may also look at these useful functions in excel –

  • 35+ Courses
  • 120+ Hours
  • Full Lifetime Access
  • Certificate of Completion
LEARN MORE >>

Reader Interactions

Leave a Reply

Your email address will not be published. Required fields are marked *