Syntax
| Parameter | Description |
|---|---|
| number1 | Parameter of the BITAND function. |
| number2 | Parameter of the BITAND function. |
Examples
Basic AND operation
=BITAND(5, 3)
Test if a flag bit is set
=BITAND(13, 4)
Subnet mask application
=BITAND(192, 240)
Common Errors
One or both numbers is negative, or exceeds 2^48 - 1 (281,474,976,710,655).
An argument is non-numeric.
Tips
To test if flag bit N is set: IF(BITAND(value, 2^N) > 0, "Set", "Not set"). This is standard practice in systems programming.
BITAND doesn't support negative numbers. If you're working with signed values, convert them first.
Maximum supported value is 2^48-1. This covers most practical use cases but won't handle 64-bit integers directly.
Try BITAND in Viztab
Import your data and use BITAND with 370+ other formulas. No signup required.
Open Viztab