HEX2BIN

Converts a hexadecimal number to binary.

Sample Usage

HEX2BIN(5)
HEX2BIN(C5)

Syntax

HEX2BIN(number, [places])

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

Examples

HEX2BIN(5) returns a value of 101.
HEX2BIN(5,5) returns a value of 00101.
HEX2BIN(C5) converts the decimal number contained in C5 to binary.

Notes

  • If number is negative, the value of places is ignored and HEX2BIN returns a 10-character binary number. 
  • number cannot contain more than 10 characters.
  • Hexadecimal digits are not case-sensitive.
  • number can have a maximum value of 1FF if positive, and a minimum of FFFFFFFE00 if negative. 
  • If number is not a valid hexadecimal number, HEX2BIN returns the #NUM! error value.
  • If places is not an integer, it is truncated.
  • If places is non-numeric, HEX2BIN returns the #VALUE! error value.
  • If places is negative, HEX2BIN returns the #NUM! error value.
  • If the number of digits required is greater than the specified places, the #NUM! error is returned.