Contact

BITXOR in WPS Spreadsheet: Apply Bitwise Exclusive Or to Integer Flags

Engineering Intermediate WPS Spreadsheet

Use BITXOR in WPS Spreadsheet with original bit-mask examples, the documented 48-bit integer domain and explicit error rules.

Verification status: See the evidence and test scope described in this guide. How formula examples are checked

Quick answer: BITXOR performs bitwise exclusive OR on two nonnegative decimal integers and returns a decimal integer. =BITXOR(13,10) is expected to return 7. A result bit is 1 when exactly one input bit at that position is 1; two matching bits give 0.

Syntax and accepted inputs

=BITXOR(number1,number2)

Both arguments are required. The official WPS lesson requires integers from 0 through 281474976710655, inclusive; the upper limit is 2^48−1. Enter ordinary decimal integer values. The function interprets their bits internally; it does not return a string of binary digits.

A value such as decimal 13 corresponds to binary 1101. Entering the decimal number 1101 instead supplies a different integer, not a declaration that the digits are binary. Use a conversion function when the source data is genuinely binary text, and check that its signed convention is suitable.

Worked example: inspect every bit

  1. On a fresh worksheet, enter the number 13 in A2 and 10 in B2.
  2. Enter =BITXOR(A2,B2) in C2.
  3. The independent expected result is 7. Display it as an ordinary number rather than a date or percentage.
  4. Check the four positions with weights 8, 4, 2 and 1:
Weight Bit in 13 Bit in 10 Bitwise exclusive OR result
8 1 1 0
4 1 0 1
2 0 1 1
1 1 0 1

Sum the weights whose result bit is 1 to obtain 7. This is a position-by-position calculation, not arithmetic multiplication, addition or a Boolean TRUE/FALSE test. Leading zero positions above weight 8 contribute nothing in this example.

Practical application: flag values

Compare an old setting 13 with a new setting 10. =BITXOR(13,10) gives 7, whose weights 1, 2 and 4 identify changed positions. Weight 8 is absent because it was enabled in both. The result identifies differences but does not identify which side enabled a changed bit; retain both original settings to determine direction.

XOR can also toggle a known flag. =BITXOR(13,2) gives 15, and toggling weight 2 again gives 13. This reversible arithmetic is useful for small flag demonstrations, but it is not encryption or a security guarantee. Using the same complete input twice gives zero, so zero can serve as an equality check for valid integer flag values.

Boundary controls and documented errors

Formula Expected result Explanation
=BITXOR(0,13) 13 Apply the operation to an all-zero input
=BITXOR(13,13) 0 Matching input positions
=BITXOR(281474976710655,1) 281474976710654 Inclusive 48-bit maximum
=BITXOR(-1,1) #NUM! Negative argument
=BITXOR(1.5,1) #NUM! Fractional argument
=BITXOR(281474976710656,1) #NUM! One above the maximum
=BITXOR("bad",1) #VALUE! Nonnumeric argument

These error categories are explicitly documented by WPS. In particular, the lesson specifies rejection of fractions, rather than truncation. Changing a cell’s displayed decimal places does not make its stored fractional value an integer.

Troubleshooting and portability

Keep imported flag values as exact integers and validate them before applying the operation. The bounded domain has 48 bit positions; do not assume that negative values use the same signed representation as BIN2DEC, or that a programming language’s arbitrary-width integer rules apply.

The cited lesson does not resolve blank-cell treatment, logical-value coercion, numeric text, array arguments, omitted arguments or error precedence when both inputs are invalid. The examples therefore use explicit numeric scalars and one clearly invalid input at a time. No runtime behavior is inferred for those additional cases.

A decimal output can still be a bit mask. If a report labels the result as an amount or a count, its interpretation will be misleading. Preserve a flag legend and distinguish the raw integer from a human-readable list of enabled options.

Evidence, availability and compatibility

The official WPS Academy BITXOR lesson, published 2019-06-18, is the product-specific source for this guide. It was reviewed on October 18, 2026. Its applicability field does not specify an edition, platform or numeric build. General platform links in the website footer do not establish applicability. The publication date establishes that the function was documented by that date; the first release and last supported version remain unknown. The cited lesson does not identify the function as deprecated or retired.

The examples are original, independently calculated expectations based on that documented contract. They were not executed in WPS, and no application screenshot is presented. Before exchanging a workbook, check the formula in the intended WPS edition and locale. These examples use the lesson’s English function names and comma separators; localized entry and file-format round trips have not been tested.

  • BITAND: compare the distinct BITAND bitwise operation
  • BITOR: compare the distinct BITOR bitwise operation
  • BIN2DEC: decode written binary digits under its signed ten-bit convention