HEX2BIN Function
The HEX2BIN
function in Google Sheets converts a hexadecimal number to its binary equivalent.
Syntax
HEX2BIN(signed_hexadecimal_number, [significant_digits])
- signed_hexadecimal_number`: The hexadecimal number you want to convert. This is a required parameter.
- significant_digits`: (Optional) The number of digits you want the binary number to contain.
Examples
- Basic Conversion
Convert the hexadecimal number ‘A’ to binary:
=HEX2BIN("A")
This will output 1010.
- Conversion with Significant Digits
Convert the hexadecimal number ‘A’ to binary with 8 significant digits:
=HEX2BIN("A", 8)
This will output 00001010.
- Conversion of a Negative Number
Convert the hexadecimal number ‘-F’ to binary:
=HEX2BIN("-F")
This will output 1111110001.
Notes
- The HEX2BIN function can handle hexadecimal numbers up to 10 characters long.
- If significant_digits is provided, the binary result will be padded with leading zeros to match the specified length.