BITAND in Collabora Office: Inspect Shared Flags and Test Complete Requirements
Inspect shared bits in Collabora Calc, compare any versus all required flags and extract small numeric fields within the documented positive-input scope.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: BITAND returns the numeric mask of bit positions set in both inputs. With masks 27 and 21, =BITAND(27;21) has expected result 17, because both contain the weights 16 and 1.
Availability and version history
- Introduced: the original Collabora release and launch date are not established by the reviewed sources.
- Availability: documented in Collabora Office 26.04 desktop help.
- Platform scope: online and mobile deployment support is not inferred from the desktop documentation.
- Checked: October 14, 2026. Function-specific documentation and independent controls; no native Collabora execution.
Syntax and product-specific limits
=BITAND(Number1; Number2)
The Collabora 26.04 reference describes both inputs as positive integers below 2^48, or below 281474976710656. The largest integer strictly below that bound is 281474976710655.
The source does not explicitly extend the input wording to zero or describe text/Boolean coercion, fractional values or exact native errors. These examples use strictly positive integer arguments. A result of zero is possible when positive inputs have no shared bit; that is different from certifying zero as an input.
The operation is bitwise. It differs from AND on ordinary conditions such as region=“East” and quantity>10. The meaning of each bit comes from your data specification, not from the function.
Example 1: inspect a fictional report mask
Define weights 1=summary, 2=detail, 4=charts, 8=archive and 16=checksum in D2:E6, with the labels in D and numbers in E. Enter selected mask 27 in A2.
Put =BITAND($A$2;E2) in F2 and fill through F6.
| Weight | Expected extracted value | Selected? |
|---|---|---|
| 1 | 1 | TRUE |
| 2 | 2 | TRUE |
| 4 | 0 | FALSE |
| 8 | 8 | TRUE |
| 16 | 16 | TRUE |
The mask 27 is binary 11011, or 16+8+2+1. In G2 enter =F2>0 and fill down to calculate the Boolean results. Extraction and interpretation are separate steps.
If A2 changes to 21, the extracted sequence becomes 1, 0, 4, 0 and 16. That mask enables summary, charts and checksum. Restore 27 before the next example.
Example 2: require any flag or every flag
Put requirement masks 9 and 12 in I2:I3. Mask 9 means summary plus archive; mask 12 means charts plus archive.
In J2 use =BITAND($A$2;I2) and fill down. Expected values are 9 and 8. Then evaluate =J2>0 and =J2=I2 in adjacent columns.
| Requirement | Any selected? | Every required bit selected? |
|---|---|---|
| 9 | TRUE | TRUE |
| 12 | TRUE | FALSE |
Both requirements share archive, but the second is missing charts. A nonzero intersection is therefore insufficient for an all-flags requirement. Comparing the complete intersection with the required mask answers that different question.
Advanced example: unpack two four-bit fields
A separate record format defines two positive fields, each from 1 through 15. Enter packed value 92 in L2. It is binary 01011100, with high field 5 and low field 12.
=BITAND(L2;15)
=BITRSHIFT(L2;4)
Expected values are 12 and 5. Mask 15 retains the lowest four bits; BITRSHIFT removes those positions to reveal the high field.
The independent arithmetic reconstruction is 5×16+12=92. The bit-operation reconstruction =BITOR(BITLSHIFT(5;4);12) also has expected result 92. Every argument supplied to these bit functions is positive in this fixture.
Useful checks and limits
The official control =BITAND(6;10) returns 2: 0110 and 1010 share only the weight 2. Conversely, =BITAND(1;2) has independently expected result 0, and =BITAND(27;27) returns 27.
A zero result does not imply invalid data; it can mean valid positive masks have no common flag. Likewise, a nonzero result cannot prove that a record follows the intended field definition.
Use BITOR to combine flags and BITXOR to identify differences. Native zero-input acceptance, coercion, out-of-range errors and large-result precision remain unverified. Keep the bit dictionary and original numeric masks beside any derived decisions.
References and verification
Complete function-specific documentation reviewed. Outputs are independently calculated positional, equality or arithmetic models, not captured native application results. Formulas use English names and semicolon separators; optional-argument brackets describe syntax and are not typed into a working formula.