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.
How to Calculate Log Base 2 in Excel: 2 Methods
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.
Similar Readings
- How to Calculate Natural Logarithm in Excel
- How to Do Inverse Log in Excel
- How to Log Transform Data in Excel
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.
Read More: How to Calculate Logarithmic Growth in Excel
Download Practice Workbook
You can download the following practice workbook that we have used to prepare this article.
Conclusion
In this tutorial, I have discussed 2 methods to calculate log base 2 in Excel. I hope you found this article helpful. Please, drop comments, suggestions, or queries if you have any in the comment section below.
Related Articles
- How to Calculate Log in Excel
- How to Take Log of Negative Numbers in Excel
- How to Calculate Antilog in Excel
- How to Plot Log Scale in Excel
- How to Plot Log Log Graph in Excel
- Excel Logarithmic Scale Start at 0
<< Go Back to Excel LOG Function | Excel Functions | Learn Excel
Get FREE Advanced Excel Exercises with Solutions!