This guide will explain how to convert hex numbers to decimal numbers in Excel using the HEX2DEC function.
Instead of using a formula that will take too much time and effort, we can easily get the decimal number equivalent to any hex number in Excel using the HEX2DEC
function.
The rules for using the HEX2DEC
function in Excel are as follows:
- The hex number to be converted should have less than or equal to 10 letters and numbers or alpha-numeric characters. Otherwise, it will result in a #NUM! error.
- It will only accept letters A-F and numbers 0-9.
- It is not case-sensitive for the letters. So 4D2 is the same as 4d2.
In the digital and tech world, the hexadecimal number system is often used. It is a kind of number system that has a base of 16. So the numerals in this system are called hex numbers. This system uses the digits 0-9 and letters A-F.
Furthermore, hex numbers can be converted to other number systems such as octal, binary, and decimal numbers. In this case, we will focus on converting hex numbers to decimal numbers in Excel using the HEX2DEC
function.
Let’s take an example.
Suppose you are a software designer who is working on a spreadsheet for your website. You want to convert the hex numbers to decimal numbers to make them easier to work with. But you don’t want to waste time using the formula to do it.
To make your work more efficient, you used the HEX2DEC
function in Excel to convert all the columns containing hex numbers to decimals.
Great! Let’s begin by dissecting the syntax of the HEX2DEC
function.
The Anatomy of the HEX2DEC Function
The syntax or the way we write the HEX2DEC
function is as follows:
=HEX2DEC(number)
Let’s take this formula and understand what each term means:
- = the equal sign is how we activate a function in Excel.
- =HEX2DEC() this is our
HEX2DEC
function. This function converts a hex number to a decimal number. - number refers to the hex number you want to convert to a decimal number. This must be less than or equal to 10 alpha-numeric characters. Also, it should only contain numbers 0-9 and letters A-F.
Simple, right? Before we learn the steps in converting hex numbers to decimals in Excel, let’s check an example first.
A Real Example of Converting Hex Numbers to Decimal Numbers in Excel
Now let’s take a look at a sample spreadsheet. For instance, we have a table containing hex numbers that we need to convert to decimal numbers. And it would look like this:
The first column contains the hex numbers, and the second column will be where we will input the decimal numbers.
After using the HEX2DEC
function, we can quickly convert the hex numbers to decimal numbers. Finally, the end result would look like this:
Additionally, we can do the opposite using the DEC2HEX
function. It simply converts a decimal number to a hex number.
For instance, let’s take the table above. Copy the decimal numbers to another table and empty the hex column. That will be where we will use DEC2HEX
.
After using DEC2HEX
, we finished converting the decimal numbers to hex numbers. We can check if it’s converted properly by comparing the first and second tables to see if the values match.
You can make your own copy of the spreadsheet above using the link attached below.
How to Convert Hex Numbers to Decimal Numbers in Excel
Finally, let’s learn the steps on how to convert hex numbers to decimals using the HEX2DEC
function in Excel.
1. First, create a column where you will input the converted decimal numbers.
2. Second, input the formula ‘=HEX2DEC(B3)’ in C3 or wherever you want to place the decimal number.
3. Then, press the Enter key to get the returned value. In this case, our hex number 5C35 is converted to 23605.
4. Next, drag down the formula to fill the entire column.
5. For example, we have an alpha-numeric character of 2G8. If we try to convert this to a decimal number using the HEX2DEC
function, it will return a #NUM! error.
Remember that the hex number must be less than or equal to 10 alpha-numeric characters. And these alpha-numeric characters must be only 0-9 and A-F.
6. And tada! You have successfully converted hex numbers to decimal numbers in Excel.
7. Let’s do the opposite! First, copy the decimals into another table and empty the hex number column.
8. Next, input the formula ‘=DEC2HEX(E3)’ in E3. Finally, press the Enter key to convert the decimal numbers to hex numbers.
That’s it! Now you have learned how to convert hex numbers to decimal numbers in Excel using the HEX2DEC
function. And you learned how to do the vice-versa using the DEC2HEX
function.
Are you interested in learning more about what Excel can do? You can now use the HEX2DEC
function in Excel and the various other Microsoft Excel formulas available to create great worksheets that work for you. Make sure to subscribe to our newsletter to be the first to know about the latest guides and tutorials from us.