XOR Function (Gnumeric)
Learn the XOR function in Gnumeric: Returns TRUE if an odd number of arguments evaluates to TRUE.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
XOR returns TRUE when an odd number of its usable arguments are true. With two inputs, this means exactly one is true. With three or more inputs, it is a parity test: three true inputs also return TRUE. That distinction matters when a rule requires exactly one selected choice.
Syntax and value handling
=XOR(value1[,value2,...])
Arguments can include logical values, numeric values and ranges. Numeric zero counts as FALSE; other numeric values count as TRUE. Strings and empty values are ignored in the inspected implementation. If no usable value remains, the result is #VALUE!.
The function is strict about errors: an error encountered in its arguments is returned rather than ignored merely because parity could otherwise be determined. Use actual Boolean values rather than text labels when building logic.
Retained example
=XOR(TRUE(),TRUE())
The expected result is FALSE because two true values make an even count. =XOR(TRUE(),TRUE(),TRUE()) returns TRUE because three is odd.
Three-input truth table
Enter the Boolean inputs in A2:C9 and use =XOR(A2:C2) in D2, then fill down:
| A | B | C | Expected XOR |
|---|---|---|---|
| FALSE | FALSE | FALSE | FALSE |
| FALSE | FALSE | TRUE | TRUE |
| FALSE | TRUE | FALSE | TRUE |
| FALSE | TRUE | TRUE | FALSE |
| TRUE | FALSE | FALSE | TRUE |
| TRUE | FALSE | TRUE | FALSE |
| TRUE | TRUE | FALSE | FALSE |
| TRUE | TRUE | TRUE | TRUE |
Count the TRUE entries in each row independently. Counts 1 and 3 give TRUE; counts 0 and 2 give FALSE. The final row shows why XOR is not an exactly-one validator for a three-option form.
Numeric, text and range controls
=XOR(0,2) returns TRUE: zero is false and 2 is true. =XOR(“TRUE”) returns #VALUE! because the only argument is a string and is ignored; it is not the same as =XOR(TRUE()).
For the scoped range control, A1 contains Boolean TRUE, A2 contains text “text” and A3 is empty. =XOR(A1:A3) returns TRUE because only the Boolean contributes. This is a separate sheet layout from the truth-table exercise, so do not place both datasets in the same cells at once.
Advanced use: two mutually exclusive conditions
For exactly two usable Boolean conditions, XOR is a concise exclusivity test. For example, with A2 meaning pickup selected and B2 meaning delivery selected, =XOR(A2,B2) is TRUE when one option is selected, and FALSE when neither or both are selected.
If a third option is added, count selected options explicitly for an exactly-one rule rather than extending XOR and assuming the same meaning. Likewise, missing or text inputs should be validated before treating parity as an approval or completeness signal.
Errors and troubleshooting
=XOR(TRUE(),NA()) returns #N/A. The true value does not short-circuit away the error. If a rule unexpectedly fails, inspect each input’s type and any errors before changing the Boolean expression.
A visual TRUE label may actually be text and therefore ignored. Use deliberate Boolean inputs and distinguish an empty selection from a valid FALSE. The executed controls are bounded cases; the table’s remaining rows are independently checked Boolean expectations, not separately claimed GUI tests.
Availability and verification
Version coverage: Gnumeric 1.12.57 has the scoped checks below. The 1.12.62 evidence is a documentation/source check dated October 14, 2026.
- Introduced: Gnumeric 1.1.3, documented in the official release history. This is a historical introduction record; the native controls below use 1.12.57.
- Availability: Supported in Gnumeric 1.12.62, based on the function-specific registration.
- Scope: Desktop; the fn-logical function module must be included and enabled.
- Checked: October 14, 2026. Documentation/source check; no new native test in Gnumeric 1.12.62.
The executable contract is also present in the official Gnumeric 1.12.57 fn-logical source. The saved source was originally retrieved on October 17, 2026 and re-inspected for this guide. The last functioning release is not established; support in a named version is not a retirement claim.
On October 17, 2026, Gnumeric ssconvert 1.12.57 recalculated a synthetic workbook in the C.UTF-8 locale. Scoped controls: =XOR(TRUE(),TRUE()) → False; =XOR(TRUE(),TRUE(),TRUE()) → True; =XOR(TRUE(),FALSE(),FALSE()) → True; =XOR(0,2) → True; =XOR("TRUE") → #VALUE!; =XOR(TRUE(),NA()) → #N/A; =XOR(A1:A3) → True. These are native calculation-engine results, not GUI tests or screenshots. Other tutorial layouts and displayed outputs are independent expectations unless covered by these exact formulas. Input/output files, preserved formulas, raw values and hashes were retained. The XLSX importer logged an unused workbookProtection-element warning; changed-input controls and recorded results were checked.