HEX2DEC Function in Google Sheets

Convert a hexadecimal number to a decimal number using the HEX2DEC function.

HEX2DEC Function

The HEX2DEC function in Google Sheets converts a hexadecimal number to its decimal equivalent.

Syntax

HEX2DEC(signed_hexadecimal_number)
  • signed_hexadecimal_number: The hexadecimal number you want to convert. This is a required parameter.

Examples

  1. Basic Conversion

Convert the hexadecimal number ‘1A’ to decimal:

=HEX2DEC("1A")

This will output 26.

  1. Conversion of a Negative Number

Convert the hexadecimal number ‘-F’ to decimal:

=HEX2DEC("-F")

This will output -15.

  1. Conversion of a Long Hexadecimal Number

Convert the hexadecimal number ‘ABCDEF’ to decimal:

=HEX2DEC("ABCDEF")

This will output 11259375.

Notes

  • The HEX2DEC function can handle hexadecimal numbers up to 10 characters long.
  • Negative hexadecimal numbers are represented with a leading ’-’ sign.
  • HEX2BIN: Convert a hexadecimal number to a binary number.
  • HEX2OCT: Convert a hexadecimal number to an octal number.