Skip to content

How to Use Excel DEC2HEX Function?

DEC2HEX FunctionPin
DEC2HEX Function

DEC2HEX Function in Excel: Microsoft Excel is a powerful data visualization and analysis program used all around the world. It uses spreadsheets to store, organize, or perform operations with formulas and functions. This application is developed for WindowsMacAndroid, and iOS. The major purpose of the software is to do complicated calculations which are difficult to do manually.

This article will learn how to use DEC2HEX Function in Excel using its basic syntax, explanation, and examples. Get the official version of MS Excel from the following link:

DEC2HEX FunctionPin
DEC2HEX Function

Explanation of DEC2HEX Function

  • It is one of the built-in functions in Microsoft Excel.
  • DEC2HEX Function is mainly used to convert decimal numbers into hexadecimal numbers.
  • This function is just the opposite of the HEX2DEC Function.


  • Here, you will see the syntax of the DEC2HEX function.
  • To apply this function on your spreadsheet, you have to select a cell and enter the formula in the following format.
  • Once you enter the formula, just click on the Enter button to get the result.

=DEC2HEX(number, [places])

Argument Description:

Number – The decimal integer that you want to convert to a hexadecimal value.

Places – It is optional. It is used for padding the output value with leading zeros. If you don’t mention the places, it returns the exact value of the input.

1) If several places are non-numeric, it returns #VALUE! Error.
2) If you give a negative number to places, it will show #NUM! Error value.
3) If the input number is less than -549,755,813,888 or greater than 549,755,813,887, it returns #NUM! Error.

Practical Examples

Let’s see a few examples to make it clear how the DEC2HEX function works in the spreadsheet.

  • Initially, you have to open your Excel workbook on your PC and launch a worksheet that has data.
  • For example, we have shown you a range of decimal values in Column A and places in Column B, we will convert them into hexadecimal values.
Input RangePin
Input Range
  • Then, you have to enter the formula in the cell as shown below to get the result.
Type the formulaPin
Type the formula
  • After entering the formula, you need to click the Enter button to get the output, as shown below. You can drag down the cell to fill the remaining cells.

Input that Causes Error

  • If you give a negative number to places, it will show #NUM! Error value.
  • If the input number is less than -549,755,813,888 or greater than 549,755,813,887, it returns #NUM! Error.
Num ErrorPin
Num Error
  • If either a number of places are non-numeric, it returns #VALUE! Error.
Value ErrorPin
Value Error


The above article can understand the DEC2HEX Function in Excel 365 with its syntax, explanation, and examples. Leave your feedback in the comment section. To learn more about Excel functions, then visit our webpage

Video Tutorial

The following video will show you how to apply the DEC2HEX function in your Excel spreadsheet.

Read Also:


Leave a Reply

Your email address will not be published. Required fields are marked *

Share to...