Skip to main content

DEC2HEX

Converts a decimal number to hexadecimal.

Syntax

=DEC2HEX(Number, [Places])

Arguments

NameDescription
NumberThe decimal number to convert.
PlacesOptional. The number of characters to use for returned value. If value has less characters then it is padded with leading zeros.

Return Value

The hexadecimal number or a #NUM! error if given number is not a valid decimal number. The #VALUE! error is returned if specified places is nonnumeric or negative.

Example

FunctionResultComment
=DEC2HEX(28)1Cconverts decimal 28 to hexadecimal
=DEC2HEX(28, 4)001Cconverts decimal 28 to hexadecimal with 4 characters