Learn Excel - Simplify Life with Excel Concepts

Excel BIN2HEX Function

BIN2HEX Function Example

How to use the BIN2HEX Function

This Excel tutorial explains how to use the Excel BIN2HEX function with syntax and examples.

SUMMARY:

The Excel BIN2HEX function converts a binary number to a hexadecimal number. The input number must contain only zeros and ones and be less than 10 characters long, otherwise the function returns the #NUM! error value.

For example,

  • The formula =BIN2HEX(111111) would return 3F
  • The formula =BIN2HEX(11011,4) would return 001B

PURPOSE:

To converts a binary number to hexadecimal.

RETURN VALUE:

The BIN2HEX function returns a Hexadecimal Number type. It returns a string/text value.

SYNTAX:

=BIN2HEX(number, [places])

ARGUMENTS:

The BIN2HEX function syntax has the following arguments:

  • number: Required. The binary number you want to convert to hexadecimal.
    • Number cannot contain more than 10 characters (10 bits).
    • The most significant bit of number is the sign bit. The remaining 9 bits are magnitude bits.
  • places: Optional. It specifies the number of characters that you want the returned hexadecimal number to have.
    • If this is greater than the minimum, the hexadecimal number will be padded out using leading zeros.
    • If omitted, the returned hexadecimal uses the minimum number of places.
    • If places is nonnumeric, BIN2HEX returns the #VALUE! error value.
    • If places is negative, BIN2HEX returns the #NUM! error value.
    • If places is not an integer, it is truncated.

REMARKS:

  • Negative numbers are represented using two's-complement notation.
  • If number is not a valid binary number, or if number contains more than 10 characters (10 bits), BIN2HEX returns the #NUM! error value.
  • If number is negative, BIN2HEX ignores places and returns a 10-character hexadecimal number.
  • If BIN2HEX requires more than places characters, it returns the #NUM! error value.
  • If places is not an integer, it is truncated.

Useful Links: Link 1Link 2Link 3Link 4