Related Function:

The BIN2HEX function converts a binary number to hexadecimal.

Syntax

=BIN2HEX(number,[places])

Note: Hexadecimal (base 16), decimal (base 10), octal (base 8), and binary (base 2) are the most commonly used numeral systems in engineering and computing. Therefore, Excel has provided functions to convert numeric values to and from each of these systems.

Arguments

Argument Description
number The binary number you want to convert

  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
  Negative numbers are represented using two’s-complement notation
[places] Optional. The number of characters to use

  If [places] is omitted, BIN2HEX uses the minimum number of characters necessary
  [places] is useful for padding the return value with leading 0s (zeros)

Examples

  A B C
1 Formula Result Notes
2 =BIN2HEX(11111011, 4) 00FB Converts binary 11111011 to hexadecimal with 4 characters
3 =BIN2HEX(1110) E Converts binary 1110 to hexadecimal
4 =BIN2HEX(1111111111) FFFFFFFFFF Converts binary 1111111111 to hexadecimal
5 =BIN2HEX(0000000001) 1 Converts binary 0000000001 to hexadecimal

Common Function Error(s)

Problem What went wrong
#VALUE! Occurs if the supplied [places] argument is not recognized as a number
#NUM! Occurs if either:

  the supplied number argument is not recognized as a binary number or contains more than 10 characters
  the resulting hexadecimal number requires more places than is specified by the supplied [places] argument
  the supplied [places] argument ≤ 0
#NAME? Occurs when Analysis ToolPak add-in is not enabled