# How to Calculate Log Base 2 in Excel (2 Handy Methods)

Get FREE Advanced Excel Exercises with Solutions!

The LOG function in Excel is very simple and easy to use. It is the most frequent function in finance, business analytics, and statistics. You can also this LOG function to plot a chart or graph. In this article, you will learn 2 methods to calculate log base 2 in Excel.

## What Is Logarithm (Log) in Mathematics?

In mathematics, the logarithm is the reverse operation of the exponentiation. In simple words, the logarithm value of a given number is the index to which we need to raise the base to find that number. To give you an idea, for a given number 64, 6 is the index to which base 2 should be raised to find the number 64. Therefore, a LOG of 64 is 6. In mathematics, we write it as log264=6.

## 2 Methods to Calculate Log Base 2 in Excel

### 1. Use Excel LOG Function

The LOG function in Excel computes the logarithm of a number to a particular base. In order to use the LOG function, just select a cell and type it as the image shown below. To find log base 2 in excel, just follow the steps below.

📌 Steps:

• First, select an output cell (In this example, D5) where we want to compute the logarithm value. Then, type the following formula, and finally press ENTER.
`=LOG(B5,C5)` Finally, here is the result. Read More: How to Calculate Natural Logarithm in Excel (With 4 Examples)

### 2. Apply VBA to Calculate Log Base 2

If you are comfortable with the VBA codes, then you can use the Log function in VBA to calculate log base 2 in Excel. Follow the steps below to apply VBA Log Function.

📌 Steps:

• To open a module window, go to Developer tab >> Visual Basic >> Insert >> Module. A module window will pop up. • Now, type the following code in the module window.
``````Function LogRND(N As Double, X As Double) As Double
LogRND = Log(X) / Log(N)
End Function
Sub Log_N_Based()
MsgBox LogRND(2, 1000)
End Sub`````` Here is the pop-up that shows the result. ## Related Articles Hafiz Islam

Hi there. I am Hafiz, graduated from BUET. Currently, I am working and doing research on Microsoft Excel and here I will be posting articles related to this. Now you can see my articles in the ExcelDemy blog.

We will be happy to hear your thoughts Advanced Excel Exercises with Solutions PDF  