The BitAnd function in Excel returns the bitwise ‘AND’ of two numbers.
Syntax:
=BITAND( number1, number2 )
Parameter:
Example:
The binary equivalent of 5 is 101.
The binary equivalent of 7 is 111.
The digit ‘1’ appears in places 1 and 3 in the binary digits 101 and 111. (counting from the right).
As a consequence, the bitwise ‘AND’ result is the binary number with a ‘1’ in places 1 and 3. (from the right). That is, the binary number 101.
This value is returned as the integer 5 in decimal form.
Ask Your Query