Engineering
Excel 2013
◉ 18 views
=BITXOR()
Returns a bitwise 'XOR' of two numbers.
Applies To:
Excel for Microsoft 365Excel for Microsoft 365 for MacExcel 2024Excel 2024 for MacExcel 2021Excel 2021 for MacExcel 2019Excel 2016
=BITXOR(number1, number2)
Hover argument names in the table for details.
Output typeNumber/Text
Popularity35 / 100
VolatileNo
Dynamic ArrayNo
Download sample .xlsx ▦ Try in Playground
Dedicated file for this function — safe & lightweight · sample data + live formulas
⬇ Download Sample Workbook
A dedicated .xlsx for =BITXOR() with Persian sample data & live formulas — open in Excel and practice.
- Sheet “Sample” — data table + formula in place
- Sheet “Guide” — syntax, arguments & tips from this page
- Instant & secure (token + rate limit)
Quiz this function
%d questions — syntax, example & errors — test yourself!
◧ Arguments
| Argument | Type | Required | Description |
|---|---|---|---|
number1 |
Number | Required | Must be greater than or equal to 0. |
number2 |
Number | Required | Must be greater than or equal to 0. |
▣ Examples
Returns the total of the bitwise "Exclusive Or" comparision at each bit position.
=BITXOR(5,3)
Result:
6
§ Remarks
- BITXOR returns a decimal number that is the result of the sum of a bitwise 'XOR' (exclusive XOR) of its parameters.
- If either argument is outside its constraint, BITXOR returns the #NUM! error value.
- If either argument is greater than (2^48)-1, BITXOR returns the #NUM! error value.
- If either argument is a non-numeric value, BITXOR returns the #VALUE! error value.
- In the result, each bit position is 1 if the values of the parameters at that bit position are not equal; in other words, one value is 0 and the other is 1. For example, using BITXOR(5,3), 5 is expressed as 101 in binary and 3 as 11 in binary. To help with comparison, you can consider 3 as 011. From right to left, the bit values at the three positions in this example are the same (1) only at the rightmost position. A 'not equal' result returns a 1 for the second and third positions from the right, and an ‘equal’ result returns 0 for the rightmost position.
- Values of 1 returned from the bit positions progress from right to left as powers of 2. The rightmost bit returns 1 (2^0), the bit to the left returns 2 (2^1), and so on.
- Using the same example, 0 is returned for the rightmost bit position because it is a 0, 2 (2^1) is returned for the second bit position from the right (a 1 value), and 4 (2^2) is returned for the leftmost bit (also a 1 value). The total is 6, in decimal representation.
✦ Tips
- BITXOR returns a decimal number that is the result of the sum of a bitwise 'XOR' (exclusive XOR) of its parameters.
- In the result, each bit position is 1 if the values of the parameters at that bit position are not equal; in other words, one value is 0 and the other is 1. For example, using BITXOR(5,3), 5 is expressed as 101 in binary and 3 as 11 in binary. To help with comparison, you can consider 3 as 011. From right to left, the bit values at the three positions in this example are the same (1) only at the rightmost position. A 'not equal' result returns a 1 for the second and third positions from the right, and an ‘equal’ result returns 0 for the rightmost position.
- Values of 1 returned from the bit positions progress from right to left as powers of 2. The rightmost bit returns 1 (2^0), the bit to the left returns 2 (2^1), and so on.
- Using the same example, 0 is returned for the rightmost bit position because it is a 0, 2 (2^1) is returned for the second bit position from the right (a 1 value), and 4 (2^2) is returned for the leftmost bit (also a 1 value). The total is 6, in decimal representation.
⚠ Common Errors
#NUM!
If either argument is outside its constraint, BITXOR returns the #NUM! error value. If either argument is greater than (2^48)-1, BITXOR returns the #NUM! error value.
Fix: 0 to 2^48-1
#VALUE!
If either argument is a non-numeric value, BITXOR returns the #VALUE! error value.
Fix: هر دو آرگومان را بهصورت عددی وارد کنید.
💬 Comments & Q&A 0 approved
🔒 Your comment will be published after review.Share your thoughts — visible after admin approval
No comments yet — be the first!