ReferenceFunctionsEngineering Functions
DEC2HEX
DEC2HEX: Converts a decimal integer to hexadecimal text.
Summary
Optionally pads the result with leading zeros using places.
Remarks
numberis coerced to an integer and must be in[-2^39, 2^39 - 1].- Negative values are returned as 10-digit two's-complement hexadecimal strings.
placesmust be at least the output width and at most10, or#NUM!is returned.
Examples
Convert decimal to hex
Grid
| Cell | Value | |
|---|---|---|
| No inputs on Sheet1. | ||
Formula
=
Result
Not evaluated yet.
Expected
FF
Pad hexadecimal output
Grid
| Cell | Value | |
|---|---|---|
| No inputs on Sheet1. | ||
Formula
=
Result
Not evaluated yet.
Expected
001F
Related functions
FAQ
How are negative values formatted by DEC2HEX?
Negative outputs use 10-digit two's-complement hexadecimal representation.
Runtime metadata
Category
Engineering
Signature
DEC2HEX(arg1: Number, arg2…: Number)Arity
min 1, max variadic
Arguments
arg1Number · Scalar · coercion NumberLenientText
arg2Number · Scalar · coercion NumberLenientText
Caps
PURE
Source