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 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,

**2 ^{5 }= 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_{2}32 =5, that is a LOG of 32 to the base 2 is 5.

### LOG Formula in Excel

**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 base to which the logarithmic value is calculated, and LOG function in Excel by default takes the base as 10.

**How to Use LOG Function in Excel?**

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

The Logarithmic function is used for mathematical operations and is widely used in financial statistics. 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, 4^{5 = }1024, using POWER function 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 would get the exponent which is passed as a second argument in the 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.

4.9 (1,353 ratings) 35+ Courses | 120+ Hours | Full Lifetime Access | Certificate of Completion

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=log_{10}(A/A_{0})

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

**=LOG((A/A _{0}),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 Excel sheet in Column B and we want to find which solution is acidic, alkaline or water. The Data table is given below:

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

**pH=-log _{10}[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 it 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 value is greater than, less than or equal to 7.

Using the formula in other cells we have,

**Output:**

** **

**T**he 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 the 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 the 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,

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:**

**Step 2:**

** ****Step 3:**

** ****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 **log _{2}N, where n is the number of items**

**=LOG(16,2) = 4**

Hence, to search an item in an array of items, the binary search will take **log _{2}N **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 step it will take to find an item from the given items.

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)**

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 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