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

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.

Use LOG Function

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)

Use LOG Function to Calculate Log Base 2 in Excel

Finally, here is the result.

Use LOG Function to Calculate Log Base 2 in Excel


Similar Readings


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.

Apply VBA Log Function

  • 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

Apply VBA Log Function to Calculate Log Base 2 in Excel

Here is the pop-up that shows the result.

Apply VBA Log Function

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


<< Go Back to Excel LOG Function | Excel Functions | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Hafizul Islam
Hafizul Islam

Hafizul Islam is an excellent marine engineer who loves working with Excel and diving into VBA programming. For him, programming is like a superhero tool that saves time when dealing with data, files, and the internet. His skills go beyond the basics, including Rhino3D, Maxsurf C++, AutoCAD, Deep Neural Networks, and Machine Learning. He got his B.Sc in Naval Architecture & Marine Engineering from BUET, and now he's switched gears, working as a content developer. In this role,... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo