DEC2HEX

  • Updated

Converts a decimal number to hexadecimal.

Sample Usage

DEC2HEX(115)
DEC2HEX(C5)

Syntax

DEC2HEX(number, [places])

  • number - The decimal number to be converted.
  • places - [OPTIONAL] The number of places in the output.

Examples

DEC2HEX(115) returns a value of 73.
DEC2HEX(115,3) returns a value of 073.
DEC2HEX(C5) converts the decimal number contained in C5 to hexadecimal.

Notes

  • If number is negative, the value of places is ignored and DEC2HEX returns a 10-character hexadecimal number in which the most significant bit is the sign bit. The remaining bits are magnitude bits. 
  • If number < -549,755,813,888 or if number > 549,755,813,887, DEC2HEX returns the #NUM! error value.
  • If number is non-numeric, DEC2HEX returns the #VALUE! error value.
  • If places is not an integer, it is truncated.
  • If places is non-numeric, DEC2HEX returns the #VALUE! error value.
  • If places is negative, DEC2HEX returns the #NUM! error value.
  • If the number of digits required is greater than the specified places, the #NUM! error is returned.