Get instant live expert help with Excel or Google Sheets
“My Excelchat expert helped me in less than 20 minutes, saving me what would have been 5 hours of work!”

Post your problem and you’ll get Expert help in seconds.

Your message must be at least 40 characters
Our professional Expert are available now. Your privacy is guaranteed.

How to use the Excel DEC2HEX Function

We have some very effective functions when it comes to working with numbers in Excel. DEC2HEX is one such function. It takes a decimal number and converts it to its hexadecimal counterpart. In this tutorial, we will learn how to use the DEX2HEC function in Excel.

Figure 1. Example of How to Use the DEC2HEX Function in Excel

Syntax for DEC2HEX Function

=DEC2HEX(number, [places])

  • Number: Required. This is the decimal number to convert to its hexadecimal equivalent.
  • [places]: Optional. Rounds up the output number with zeros up to the digits specified. If we omit it, DEC2HEX returns the minimum number of characters needed to show the number.

Setting up Data

The following data set has some sample decimal numbers. Column A contains the numbers.

Figure 2. The Sample Data Set

To convert these numbers to hexadecimal in column B:

  • We need to click cell B2 with the mouse.
  • Assign the formula =DEC2HEX(A2,7) to the formula bar of cell B2.
  • Press Enter.

Figure 3. Example of Applying the DEC2HEX Function

  • Assign the formula =DEC2HEX(A3) to cell B3. Press Enter and drag the fill handle from cells B3 to B5.

Column B will now have the hexadecimal representation of the decimal numbers in column A. Cell B2 has the formula with the places argument 7. This rounds up the output 600D with 0’s in the first three digits.


  • The DEC2HEX function requires a valid input of a decimal number within the range [ -2^39, 2^39 – 1]. Otherwise it returns a #NUM! error.
  • DEC2HEX returns a #VALUE! error if the number is non numeric.
  • It returns a #NUM! Error if the result of DEC2HEX requires more numbers than the places argument.
  • Excel truncates the value of the places argument if it is not an integer.
  • DEC2HEX returns a #VALUE! error if places is non numeric. It returns a #NUM! error if places is negative.

Figure 4. Example of Common Errors of the DEC2HEX Function

Most of the time, the problem you will need to solve will be more complex than a simple application of a formula or function. If you want to save hours of research and frustration, try our live Excelchat service! Our Excel Experts are available 24/7 to answer any Excel question you may have. We guarantee a connection within 30 seconds and a customized solution within 20 minutes.

Solution examples
I need a formula that has these 2 rules. If letter was rec'd between 1st and 15th = 1st of the month following letter rec'd date. If letter was rec'd between 16thst and end of the month= 1st of the 2nd month following letter rec'd date.
Solved by V. F. in 20 mins
I need a column to total (Hours)(85) + (Travel)(.55) per line
Solved by F. Q. in 20 mins
Trying to figure out what is wrong with my formula in Oct-ZD tab in column AY and BG.
Solved by O. Q. in 8 mins
So I have used vlookup to find the price of a product on a different sheet and then I have tried to times that by a quantity. e.g. =vlookup(d4,table35,2,false)*e4 This is the formula I typed in which worked for another list I did but for some reason it's not working now even though everything is practically the same, apart from the contents. Could you help?
Solved by B. U. in 60 mins
I have a column containing date and time data together and i need to isolate the time data. When I tried to use text to column, it changed all the times to AM. There is an extremely large amount of data - over 550,000 rows so manually changing it won't work. The file is too large to attach.
Solved by S. E. in 40 mins

Leave a Comment


Subscribe to

Get updates on helpful Excel topics

Subscribe to
Trusted by people who work at, Inc
Facebook, Inc
Accenture PLC
Siemens AG
The Allstate Corporation
United Parcel Service
Dell Inc