# How to Convert Decimal Number to Hexadecimal (Hex) in Excel

Get FREE Advanced Excel Exercises with Solutions!

The article will focus on some key aspects of how to convert decimal numbers to hexadecimal format (hex) in Excel. There are many technical applications of hexadecimal numbers such as Assembly and Machine language. Programmers frequently use this number format to insert memory addresses. It can also be used to represent numbers kept in a CPU’s registers or in main memory as well as during the debugging phase of programming. It has a large application in data processing. So a computer or software engineer can effectively use Excel to convert decimal numbers to hexadecimal. The process of this conversion is very easy and time-saving.

## 2 Practical Ways to Convert Decimal Number to Hexadecimal (Hex) in Excel

In the dataset, we have some positive and negative decimals. We will convert them to hexadecimal in the following sections. ### 1. Using Excel DEC2HEX Function to Convert Decimal to Hex (Hexadecimal)

Excel has a built-in function to convert a decimal number to its hexadecimal format. The name of this function is DEC2HEX. Let’s have a look at it’s application.

Steps:

• First, make a column to store the hexadecimal numbers and type the following formula in its first cell.

`=DEC2HEX(B5)` • After that, press the ENTER.  Thus you can convert any decimal number to hexadecimal format (hex) using Excel DEC2HEX function.

Read More: [Solved]: HEX2DEC Not Working in Excel

### 2. Converting Decimal to Hexadecimal with Colon

In some databases, the digits of a hexadecimal number need to be separated by colon symbols when the numbers are very large. To understand the procedure, please have a glance at the following description.

Steps:

• First, make a column to store the hexadecimal numbers and type the following formula in cell C5.

`=IF(MOD(LEN(DEC2HEX(B5)),2)=1,"0"&MID(DEC2HEX(B5),1,1)&":"&MID(DEC2HEX(B5),2,2)&":"&MID(DEC2HEX(B5),4,2)&":"&MID(DEC2HEX(B5),6,2)&":"&MID(DEC2HEX(B5),8,2),MID(DEC2HEX(B5),1,2)&":"&MID(DEC2HEX(B5),3,2)&":"&MID(DEC2HEX(B5),5,2)&":"&MID(DEC2HEX(B5),7,2)&":"&MID(DEC2HEX(B5),9,2))` The formula uses various functions like IF, MOD, LEN, MID and DEC2HEX to complete the operation. Basically, these functions (except DEC2HEX) help to insert colons inside the hexadecimal number.

• After that, press the ENTER button and you will see the decimal number in B5 converted to a hexadecimal number. • Thereafter, drag the Fill icon to AutoFill the lower cells. Thus you can get all the large decimal numbers as hexadecimal numbers (hex) with colons.

Read More: How to Convert Hex to Decimal in Excel (2 Practical Examples)

## How to Convert Decimal Number to Other Number Formats

We can convert the decimals not only to the hexadecimal format but also to other formats like binary and octal. For that purpose, we use similar formulas with the DEC2BIN and DEC2OCT functions. Let’s follow the instructions below for a detailed overview. The DEC2BIN and DEC2OCT functions convert a decimal number to its binary and octal format.

Steps:

• First, store your decimal numbers in a column and type the following formula to convert them to binary

`=DEC2BIN(B5)` • Next, use the Fill Handle to AutoFill the lower cells. Thus you can convert your decimal data to binary format.

• Now, if you wish to convert the numbers to octal format, just use the formula given below.

`=DEC2OCT(B5)` • After that, fill the lower cells using the Fill Handle. Thus you can convert a decimal number to other number formats such as binary and octal.

Read More: How to Convert Binary to Decimal in Excel (2 Easy Methods)

## Things to Remember

• For the DEC2HEX function, the range of numbers that can be converted is [-2^39, 2^39 – 1] or [-549,755,813,888, 549,755,813,887]. If we insert any decimal number out of this range, the formula will return the Number (#NUM!)
• Similarly, the applicable number range for DEC2BIN and DEC2OCT functions are [-512,511] and [-536,870,912, 536,870,911]

## Practice Section

Here, I’m giving you the dataset of this article so that you can practice these methods on your own and gain expertise. ## Conclusion

In the end, we can conclude that the article will provide you some useful idea to convert a decimal number to its hexadecimal (hex) format. If you have any better suggestions or questions or feedback regarding this article, please share them in the comment box. This will help me enrich my upcoming articles. For more queries, kindly visit our website ExcelDemy.

## Related Articles Meraz Al Nahian

Hello, Nahian here! I do enjoy my efforts to help you understand some little basics on Microsoft Excel I've completed my graduation in Electrical & Electronic Engineering from BUET and I want to be a successful engineer in my life through intellect and hard-work, and that is the goal of my career.

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