How to Use the HEX2BIN Function in Excel

Today, we’ll explore the HEX2BIN function, a useful tool in both Excel and Google Sheets for converting hexadecimal numbers into binary numbers. We will examine the function’s syntax, showcase practical examples, and demonstrate how to apply this function effectively.

Basic Syntax

The HEX2BIN function uses the following syntax:

=HEX2BIN(number, [places])
  • number: This required argument represents the hexadecimal number you wish to convert into binary.
  • [places]: This optional argument defines the number of characters the function should return. If omitted, the function will return a binary number with the minimum required number of digits.

Examples of Using HEX2BIN Function

Here are several examples to illustrate how the HEX2BIN function is utilized.

Example 1: Simple Conversion

Consider a situation where the hexadecimal number ‘1A’ resides in cell A1. To convert this to its binary form, use the following formula:

=HEX2BIN(A1)

The result will be ‘11010’, the binary equivalent of the hexadecimal ‘1A’.

Example 2: Specifying the Number of Places

To limit the binary output to a specific number of characters, include the places argument. For example, if we require only 4 binary digits, the formula would be:

=HEX2BIN(A1, 4)

This returns ‘1010’ as the result.

Example 3: Using in Conditional Formatting

The HEX2BIN function can also be a powerful tool in conditional formatting. It can help highlight cells based on their binary representations by setting conditional formatting rules that recognize specific binary outputs.

Conclusion

The HEX2BIN function is a straightforward yet powerful tool in Excel and Google Sheets for converting hexadecimal to binary numbers. With a clear understanding of its syntax and multiple use cases, you can effectively manage and display hexadecimal and binary data in your spreadsheets.

More information: https://support.microsoft.com/en-us/office/hex2bin-function-a13aafaa-5737-4920-8424-643e581828c1

Other functions
Returns the modified Bessel function In(x)
Returns the Bessel function Jn(x)
Returns the modified Bessel function Kn(x)
Returns the Bessel function Yn(x)
Converts a binary number to decimal
Converts a binary number to hexadecimal
Converts a binary number to octal
Returns a 'Bitwise And' of two numbers
Returns a value number shifted left by shift_amount bits
Returns a bitwise OR of 2 numbers
Returns a value number shifted right by shift_amount bits
Returns a bitwise 'Exclusive Or' of two numbers
Converts real and imaginary coefficients into a complex number
Converts a number from one measurement system to another
Converts a decimal number to binary
Converts a decimal number to hexadecimal
Converts a decimal number to octal
Tests whether two values are equal
Returns the error function
Returns the error function
Returns the complementary error function
Returns the complementary ERF function integrated between x and infinity
Tests whether a number is greater than a threshold value
Converts a hexadecimal number to decimal
Converts a hexadecimal number to octal
Returns the absolute value (modulus) of a complex number
Returns the imaginary coefficient of a complex number
Returns the argument theta, an angle expressed in radians
Returns the complex conjugate of a complex number
Returns the cosine of a complex number
Returns the hyperbolic cosine of a complex number
Returns the cotangent of a complex number
Returns the cosecant of a complex number
Returns the hyperbolic cosecant of a complex number
Returns the quotient of two complex numbers
Returns the exponential of a complex number
Returns the natural logarithm of a complex number
Returns the base-10 logarithm of a complex number
Returns the base-2 logarithm of a complex number
Returns a complex number raised to an integer power
Returns the product of complex numbers
Returns the real coefficient of a complex number
Returns the secant of a complex number
Returns the hyperbolic secant of a complex number
Returns the sine of a complex number
Returns the hyperbolic sine of a complex number
Returns the square root of a complex number
Returns the difference between two complex numbers
Returns the sum of complex numbers
Returns the tangent of a complex number
Converts an octal number to binary
Converts an octal number to decimal
Converts an octal number to hexadecimal