Contact

XOR Function (OpenOffice Calc)

Logical Intermediate OpenOffice Calc

Learn the XOR function in Apache OpenOffice Calc: 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

Availability and version history

  • Introduced: Apache OpenOffice 4.0.
  • Availability: Supported in Apache OpenOffice 4.1.16, verified against its function registry. This identifies a supported release, not a final working version.
  • Scope: Desktop Calc, using the English function name. Availability in other spreadsheet applications is separate.
  • Checked: 2026-10-14 — function reference; versioned support; release history. Documentation/source check; not a new native test. Existing example-specific test claims below retain their stated scope.

XOR returns TRUE when an odd number of participating inputs are true. For two inputs, that means exactly one is true. For three or more, it is a parity test: three true inputs also yield TRUE. The pinned interpreter repeatedly applies exclusive OR, despite a legacy resource description that says exactly one.

Syntax and arguments

=XOR(logical_1; logical_2; ...)

At least one argument is required; the retained resource describes 1 to 30 conditions. A numeric zero contributes false and a nonzero number contributes true. Inputs can include references or ranges. The result depends on how many inputs are true, not on adding their magnitudes or on whether the total numeric sum is odd. Examples use English function names and semicolon argument separators.

Reproducible examples

Formula Expected result
=XOR(TRUE();TRUE()) FALSE
=XOR(TRUE();FALSE()) TRUE
=XOR(FALSE();FALSE()) FALSE
=XOR(TRUE();TRUE();TRUE()) TRUE
=XOR(2;4;6) TRUE
=XOR(-1;1) FALSE

The first formula preserves the original example and result. Its historical comparable LibreOffice 25.2 check was not an OpenOffice test. New results are independent reference expectations checked against the pinned source, not fresh native worksheet captures.

Practical worksheet: require one of two selections

Use Pickup in A1 and Delivery in B1. Enter rows (1;0), (0;1), (1;1) and (0;0) in A2:B5, with 1 meaning selected and 0 meaning unselected. In C2 enter =XOR(A2;B2) and fill down. Results are TRUE, TRUE, FALSE and FALSE. Thus either single choice passes, while both or neither fails.

In D2 enter =IF(C2;"One choice";"Check choices") and fill down. The first two rows show One choice. This model assumes validated 0/1 flags; the raw numeric value 2 would also count as true, so XOR alone is not a flag-domain validator.

Advanced applications

Do not generalize two-choice exclusivity. Enter 1, 1 and 1 in A2:C2. XOR(A2:C2) is TRUE because three is odd, but three selected items are not exactly one. To require exactly one among validated 0/1 flags, use =SUM(A2:C2)=1; that returns FALSE for this row. A row 1,0,0 gives TRUE under both rules.

Use parity deliberately. For four validated flags, XOR is TRUE when one or three are selected and FALSE when zero, two or four are selected. This can summarize a parity condition, but it is not cryptographic validation or a substitute for inspecting each recorded input.

Check the Boolean identity. For two valid logical inputs, XOR(P;Q) equals AND(OR(P;Q);NOT(AND(P;Q))). Enumerating the four input pairs is a useful audit. The identity concerns valid logical values; it does not assert identical evaluation behavior for errors or text coercion.

Errors, edge cases and troubleshooting

The inspected callback rejects direct string arguments through its no-value error path. Text and empty cells encountered through ordinary references/ranges do not contribute numeric truth values. If no usable value remains, the callback returns a no-value error rather than inventing TRUE or FALSE. Thus an all-text/empty range is not a reliable empty-set logical identity.

An error among the participating inputs is not made safe by another condition that already determines the logical answer. Do not rely on XOR as a short-circuit guard for division or other unsafe expressions. Check the risky calculation separately or use a deliberately tested conditional structure.

A range result is one aggregate logical value, not a row-by-row result for every cell. For record-level rules, write explicit comparisons on one row and fill down. The source has separate reference, range and matrix paths; these ordinary examples do not certify all array, text-coercion or error-display behavior. Hidden missing values can be ignored rather than fail the rule, so validate required input fields independently.

Documentation and verification

See the Apache OpenOffice XOR reference, 4.1.16 function resources and versioned interpreter. The official source snapshots were retrieved October 13, 2026 and re-read for this guide; their dates have not been relabeled as fresh retrievals. Boolean truth tables, scalar type models and worksheet calculations are independently checked. No new native/headless application or GUI execution is claimed. XOR was introduced in Apache OpenOffice 4.0, as documented in the preserved release-history section. The final functioning version remains unestablished; documented support in 4.1.16 is a separate finding.