How to Use the BITAND Function in Excel

In both Microsoft Excel and Google Sheets, the BITAND function is utilized to execute a bitwise AND operation between two numerical values. This function outputs a decimal number, which represents the result of the AND operation applied to the individual bits of the input numbers. In the resulting number, a bit is set to 1 only if the corresponding bits in both input numbers are also 1; otherwise, the bit is set to 0.

Overview of Syntax:

The syntax for the BITAND function is consistent across both Excel and Google Sheets:

=BITAND(number1, number2)

Here, number1 and number2 are the two decimal numbers upon which the bitwise AND operation will be performed.

Examples:

To better illustrate how the BITAND function operates, consider the following examples:

Example 1:

Imagine you need to determine the bitwise AND result for the numbers 5 and 3 in Excel or Google Sheets. The function would be applied as follows:

number1 number2 Result
5 3 =BITAND(5, 3)

The result of this operation is 1. This is because the binary representation of 5 is 101, and 3 is 011. The AND operation on each bit results in 001, which corresponds to 1 in decimal.

Example 2:

Consider a somewhat more complex scenario where the bitwise AND result for 15 and 9 is sought:

number1 number2 Result
15 9 =BITAND(15, 9)

The result of =BITAND(15, 9) is 9. In binary terms, 15 is represented as 1111, and 9 as 1001. The AND operation across each bit results in 1001, which represents 9 in decimal.

Understanding and applying the BITAND function with these examples can help you proficiently perform bitwise AND operations in both Excel and Google Sheets.

More information: https://support.microsoft.com/en-us/office/bitand-function-8a2be3d7-91c3-4b48-9517-64548008563a

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 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 binary
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