Excel **XOR** function is an exclusive **OR** function. The **XOR** function returns **TRUE** if an odd number of logical statements are **TRUE** and **FALSE** if an even number of logical statements are **TRUE**. In the case of two given arguments, the **XOR** function returns **TRUE** whenever one argument is **TRUE** and **FALSE** whenever both arguments are **TRUE** or **FALSE**.

In this article, youâ€™ll get to learn how to use the **XOR** function with case base examples.

**Table of Contents**hide

**Download Excel Workbook**

**Excel XOR Function: Syntax and Arguments**

**â¦˝ Function Objective: **

Performing exclusive** OR **function

**â¦˝ Syntax:**

**XOR(logical1, [logical2],â€¦)**

**â¦˝ Arguments Explanation:**

Â Â Â Â Â Â Â Â Â Â Arguments |
Â Â Â Â Â Â Â Â Required/Optional |
Â Â Â Â Â Â Â Â Â Â Â Explanation |
---|---|---|

Â Â Â Â Â Â Â Â Â Â Â Â Â logical1 |
Â Â Â Â Â Â Â Â Â Â Â Required |
Â Â Â Â Any Kind of Logical Expression |

Â Â Â Â Â Â Â Â Â Â Â Â Â logical2 |
Â Â Â Â Â Â Â Â Â Â Â Optional |
Â Â Â Â Any Kind of Logical Expression |

**â¦˝ Return Parameter:**

**TRUE or FALSE, **depending on the **odd** or **even** number of logical statements being **TRUE** or **FALSE **respectively.

**â¦˝ Version:**

**Excel 2019**

**5 Suitable Examples to Use the Excel XOR Function **

**Example 1: XOR Function Compares Two Numbers as Logical**

The **XOR** function in-built takes logical statements that can be **TRUE** or **FALSE**. Afterward, the **XOR** function returns **TRUE** or **FALSE** depending on logical statementsâ€™ number of **TRUE** or **FALSE**.

We can come up with logical status for both values inserted as logical in **TRUE** or **FALSE** if one of them is **TRUE** or both are either **TRUE** or **FALSE**.

**â§«** Enter the following logical operations with **XOR** functions in cells (i.e.,**C6**,**C7**,**C8**)

**â†(2>1,0<1)**

**â†(2>1,0>1)**

**â†(2<1,0>1)**

The logical operations are built by comparing two numbers with a condition. If any logical statement satisfies the condition, it returns **TRUE** otherwise **FALSE**. Then **XOR** returns

đź”„ **FALSE**; If both logical statements are **TRUE** (i.e.,**2>1 is TRUE, and 0<1 is TRUE**) or **FALSE** (i.e.,**2<1 is FALSE, and 0>1 is FALSE**).

đź”„ **TRUE**; If one of the logical statements is **TRUE or FALSE** (i.e.,**2>1 is TRUE, and 0>1 is FALSE**).

**Read More:** **How to Use TRUE Function in Excel (With 10 Examples)**

**Example 2: Using XOR Function to Predict Real-Life Events**

The **XOR** function can predict real-life events considering we give in. Suppose we want basketball match **3** to be held on the basis of prior two matches among four basketball teams.

The conditions we impose are

đź”„ Teams won both matches, wonâ€™t play the Match 3.

đź”„ Teams that won any one match, will play Match 3.

đź”„ Teams won none of the matches, wonâ€™t play the Match 3.

**â§«** Paste the following formula in any adjacent cell (i.e., **E6**).

`=IF(XOR(C6="Won",D6="Won"),"YES","NO")`

Inside the formula,

The **XOR** function returns **FALSE** if both cell references match (i.e., **Won** and **Won**) or not (i.e., **Lost** and** Lost**) otherwise **TRUE**. Then **IF** shows **â€śNOâ€ť** or **â€śYESâ€ť** in case of **FALSE** or **TRUE** **XOR** passing respectively.

**â§«** Hit **ENTER** and Drag the **Fill Handle** to bring out other outcomes regarding our imposed conditions.

Now, we can cross-check the outcomes by comparing them with imposed conditions. We find any teams that lose one match will play match 3 otherwise wonâ€™t and this scenario matches with imposed conditions.

**Similar Readings:**

**How to Use IF Function in Excel (8 Suitable Examples)****Use IFERROR Function in Excel (3 Examples)****How to Use IFNA Function in Excel (2 Examples)****Use Excel SWITCH Function (5 Examples)**

**Example 3: Comparing Two Logicals**

The **XOR** function consists of built-in logicals. In this case, we discuss what if we have two given logical outputs in **TRUE** or **FALSE** and **XOR** has to decide what will be the resultant statement **TRUE** or **FALSE?**

**â§«** Type the below formula in any adjacent cell (i.e.,**D6**)

`=XOR(B6,C6)`

**XOR** assigns **B6** and **C6** as logicals.

**â§« **Press **ENTER** then Drag the **Fill Handle**. Any single **TRUE** or **FALSE** logicals results in **TRUE** otherwise **FALSE** as shown in the following picture.

**Read More: How to Use FALSE Function in Excel (With 5 Easy Examples)**

**Example 4: Comparing Multiple Logicals**

To demonstrate **XOR**â€™s other characteristics, we take multiple logical statements. Then use the **XOR** to produce outcomes depending on the logicals.

As we mentioned earlier, **XOR** results **TRUE** if there is an odd number of **TRUE** logicals otherwise **FALSE**.

**â§«** Write down the following formula in any blank cells (i.e., **G6**).

`=XOR(B6:F6)`

**â§«** Hit **ENTER** and Drag the **Fill Handle**. Youâ€™ll see an odd number (i.e., **1**,**3**,**5**) of logicals resulting in **TRUE** causes **XOR** function to evaluate them as **TRUE** otherwise **FALSE**.

**Example 5: Customizing Return Value Depending on Duplicates**

Letâ€™s say, in an office, we have employees who enter or exit the office at any time. Now, we want to check if any employees are **In** or **Out** of the office depending on name entries.

**â§«** Paste the below formula in any adjacent cell (i.e., **D6**).

`=IF(XOR(B6=B$6:B6),"In","Out")`

Inside the formula **B6=B$6:B6** returns **TRUE** if the entry in **B6 **matches with the entry ranges from **B6** to** B6**. Any even or double occurrence of any employee names results in **FALSE**.

Then **IF** returns **â€śInâ€ť** in case of a single occurrence or **â€śOutâ€ť** in case of double or duplicate occurrence of any names.

**â§«** Press **ENTER** then Drag the **Fill Handle**. The formula labels **â€śOutâ€ť **to the duplicates among the entries.

**â§ Things to Keep in Mind**

đź”Ľ **XOR** results** #VALUE** if it finds no logical values.

đź”Ľ The **XOR** function was first introduced in **2013**.

đź”Ľ The logical statements must result in **TRUE** (i.e.,**1**) or **FALSE** (i.e.,**0**) otherwise refer to anything containing the logical value.

đź”Ľ **XOR** ignores blank cells and can be used as an array formula.

**Conclusion**

I hope the above-described uses of the **XOR** function intrigue you to use the function more efficiently. If you have further queries or feedback, please let me know in the comment section. You can check out my other articles on the **Exceldemy** website.