BITOR Function (Gnumeric)
Combine numeric flags with Gnumeric BITOR, including multiple inputs, ranges, empty collections and version-specific text and integer limits.
Verification status: 20 reference, boundary and advanced-check formulas were recalculated with Gnumeric 1.12.57 ssconvert. Retained native records and independent integer calculations were checked. Version 1.12.62 was source-checked only. How formula examples are checked
Version note: Native examples use Gnumeric 1.12.57. Current 1.12.62 source changes text conversion and the integer bound. See the version-specific section before reusing boundary results.
Quick answer: =BITOR(9,5) gives 13 in the tested Gnumeric 1.12.57 build.
Availability and version history
- Introduced: First release not established; present in the retained 1.12.57 source. Multiple-argument support was added in 1.12.51.
- Supported in: Gnumeric 1.12.62; no retirement is established.
- Scope: Desktop Gnumeric with its Number Theory plugin. English comma-separated formulas are shown.
- Checked: October 14, 2026. Tables and the named advanced check were recalculated with 1.12.57 ssconvert. Current 1.12.62 source was inspected; the later release was not executed.
What BITOR returns
BITOR keeps a bit when at least one collected numeric input has that bit set. For 9 and 5, binary 1001 OR 0101 is 1101, giving 13. It is a bit-mask operation; it does not mean the same thing as logical OR on truth values. Versioned function help.
Syntax and arguments
=BITOR(value1[,value2,...])
Supply numeric values or ranges, with additional arguments allowed. The bitwise helper floors nonnegative fractions. In native 1.12.57, text and blanks are ignored, while booleans contribute 1 and 0. With no collected numbers, the accumulator remains zero.
Brackets mark additional optional arguments; do not type the brackets. Current implementation.
Reproducible examples
For the range examples, enter numeric 1, 3 and 7 in F2:F4. Leave F5 empty. G2:G3 contain the text strings “3” and “5”, deliberately stored as text. H2:H4 contain TRUE, FALSE and numeric 2. These types were retained in the input and native outputs.
These eight native integer results were independently checked by binary arithmetic or elementary number theory.
| Formula | Gnumeric 1.12.57 result |
|---|---|
=BITOR(9,5) |
13 |
=BITOR(15,10) |
15 |
=BITOR(12,3) |
15 |
=BITOR(0,7) |
7 |
=BITOR(255,15) |
255 |
=BITOR(42,15) |
47 |
=BITOR(1,2,4) |
7 |
=BITOR(F2:F4) |
7 |
Practical worksheet
If option flags 1, 4 and 8 describe three independent choices, =BITOR(8,4,1) returned 13. OR combines the choices without double-counting a flag already present. For example, combining a stored mask of 9 with mask 5 gives 13 rather than the arithmetic sum 14.
In a worksheet, A2 and B2 can hold two validated numeric masks and =BITOR(A2,B2) combines them. Keep the flag definitions in a separate legend; a combined integer is hard to interpret without knowing which bit represents each option.
Advanced interpretation and checks
OR is associative, commutative and idempotent: combining a mask with itself leaves it unchanged. This makes a range reduction useful for asking which flags occur anywhere in a group. With F2:F4 equal to 1, 3 and 7, the union is 7.
A new flag can be set with OR regardless of whether it was previously set. XOR would toggle that flag instead, which can accidentally remove it. The result remains a numeric mask; it is not a count of selected options. For 255 OR 15, the result is still 255 because all four low bits were already set.
Version-specific source differences
Version-sensitive conversion: The tables record 1.12.57, which ignores text. Current 1.12.62 source instead requests numeric-string conversion: successfully parsed numbers participate, while failed numeric conversion gives #VALUE!. These newer conversion paths were source-checked, not executed. Older callback; current callback; string collector.
For the standard binary64 build, the older shared input bound is 2^52 = 4503599627370496. The pinned 1.12.62 expression raises it to 2^53 = 9007199254740992. This change is established by comparing the older bound with the current bound; it is not a native test of 1.12.62. Input acceptance and exact representability of every resulting integer are separate questions.
Boundaries and troubleshooting
The empty call and an all-blank numeric collection return 0 in the tested build. That identity is specific to OR and cannot be borrowed for every bitwise reducer. Negative numbers and above-bound values return #VALUE!. An ignored invalid string in 1.12.57 does not prove that the input was valid.
F5 is an actually empty cell. Listed errors are native error results, not mathematical zeroes.
| Formula | Gnumeric 1.12.57 result |
|---|---|
=BITOR() |
0 |
=BITOR(F5) |
0 |
=BITOR(-1,1) |
#VALUE! |
=BITOR(9.9,5.9) |
13 |
=BITOR("9",5) |
5 |
=BITOR("abc",1) |
1 |
=BITOR(TRUE(),FALSE()) |
1 |
=BITOR(G2:G3) |
0 |
=BITOR(H2:H4) |
3 |
=BITOR(9007199254740992,1) |
#VALUE! |
=BITOR(9007199254740994,1) |
#VALUE! |
Official evidence and checking scope
- Current worksheet implementation
- Tested-version worksheet implementation
- Current calculation helper
- Tested-version calculation helper
The retained workbook contained a deliberately stale SUM cache and an uncached SUM formula, both recalculated correctly. Native evidence covers the listed 1.12.57 cases. Other worksheet layouts and mathematical interpretations are separately explained checks. GUI entry, other locales and later-release output were not tested.