Converts a decimal number to signed hexadecimal format. Learn more
DEC2HEX is a function commonly used in Google Sheets to convert a decimal number to its corresponding hexadecimal (base 16) representation.
The DEC2HEX function takes one required argument, the decimal number that you want to convert to hexadecimal, and an optional second argument, the number of significant digits to display in the resulting hexadecimal number.
For example, if you want to convert the decimal number 255 to hexadecimal, you would use the formula =DEC2HEX(255), which would return the hexadecimal value FF (because 255 in decimal is equivalent to FF in hexadecimal notation).
If you want to limit the number of significant digits in the resulting hexadecimal value, you can include a second argument in the function. For example, the formula =DEC2HEX(255, 2) would return the value FF, while the formula =DEC2HEX(255, 4) would return the value 00FF (because it includes four digits).