The XOR function in Microsoft Excel is a unique OR function. If an odd number of logical statements in your worksheet are true and even numbers of logical statements are true, the XOR function returns TRUE. Otherwise, it returns FALSE. When given two arguments, the XOR function returns TRUE if one argument is TRUE and FALSE whenever both statements are TRUE or FALSE.

## Formula Examples & Scenarios Where you Can Use Microsoft Excel XOR Function in your Worksheet

### Example #1: Comparing Two Numbers Using the XOR Function

Built-in functions in your Excel worksheets such as XOR accept logical statements that can either be **TRUE or FALSE**. The XOR function returns **TRUE or FALSE** based on the quantity of TRUE or FALSE logical propositions.

If one is **TRUE** or both are **TRUE** or **FALSE**, we may determine the logical state for both values inserted as **TRUE or FALSE**.

- Use the XOR functions to enter the following logical operations in the cells. (i.e.,C6,C7,C8)
- (2>1,0<1)
- (2>1,0>1)
- (2<1,0>1)

The logic operations are constructed by contrasting two numerical values according to predetermined criteria. A value of **TRUE **is returned if and only if a logical assertion meets the condition; otherwise, **FALSE **is returned.

XOR gives **TRUE or FALSE** depending on whether both logical propositions are true (**2>1 is TRUE, and 01 is TRUE**) or false (**21 is FALSE and 0>1 is FALSE**).

If one logical assertion is true or false (**2>1 is true, 0>1 is false**), then the other is also true.

### Example #2: Making Accurate Predictions with the XOR Function

In case we give in, the XOR function can foretell future events. Let’s say we’re interested in staging a third basketball game between four teams based on the results of the previous two games.

#### A True Story

We specify that if a team has already won two matches, they are not required to compete in the third. Three games will be played, and the winners of any two will advance to the final match. Because neither team emerged victorious, the third match was canceled.

- Copy and paste the following formula into a nearby cell (i.e., E6).

**=IF(XOR(C6=”Won”,D6=”Won”),”YES”,”NO”)**

The XOR function inside the formula evaluates to **FALSE** if both cell references are the same (i.e., Won and Won) or different (i.e., Lost and Lost), and **TRUE** otherwise. The results of IF are **“NO” or “YES,”** depending on whether XOR evaluates to **FALSE or TRUE**.

To see alternative results based on our stipulations, press **ENTER **and move the Fill Handle.

Now, we may cross-check the outcomes by comparing them with enforced conditions. We determine that all teams that have already lost one match will compete in the third match, regardless of the imposed criteria.

### Example #3: A Contrast Between Two Logical

Built-in logic can be found in the XOR operation formula. In this context, we analyze what happens when XOR is applied to two statements, each of which has a logical **TRUE/FALSE** output, and XOR must determine whether the resulting statement is **TRUE/FALSE**.

- Substitute the following formula into an adjacent cell (i.e., D6)

**=XOR(B6,C6)**

The logic operations B6 and C6 are assigned using XOR.

- Enter, and then move the Fill Handle. If only one of the logical conditions is true, then the result is
**TRUE**; otherwise, the result is**FALSE**.

### Example #4: A Multi-Level Logic Comparison

We use several logical arguments to illustrate the additional features of XOR. The logical conditions will determine the XOR results.

In the last section, we mentioned that XOR returns **TRUE** if the number of **TRUE** logical is odd and **FALSE** otherwise.

- Fill in any unoccupied spaces with the following formula: (i.e., G6).

Input =XOR**(B6:F6), **then move the Fill Handle and press Enter. For whatever reason, the XOR function always evaluates to **TRUE** if the number of logical expressions that result in **TRUE** is odd (**such as 1, 3, 5**) and **FALSE** otherwise.

The XOR function becomes easy if you have already used the OR function in a Microsoft Office Excel spreadsheet.