Go Back

One or the other not both

Figure 1. One or The Other Not Both in Excel.

Let’s say we have two items and we want to SELECT EITHER OF THEM BUT NOT BOTH of two items, we will be using the Excel XOR function.

Generic Formula


Just one criterion is allowed to be fulfilled.

How to use the XOR Function in Excel.

We are going to utilize the XOR Function in 3 simple steps.

  1. Collect the available dates and arrange within the labeled columns of our worksheet.

See example illustrated below;

Figure 2. One or The Other Not Both in Excel.

Our purpose here is for the XOR Function to return as TRUE when one of MATH and LITERATURE is marked “x” and return as FALSE if none of MATH or LITERATURE is marked “x” and also return as FALSE if both MATH and LITERATURE have an”x”.

  1. In our example above, the XOR formula we will enter into cell D2 is as follows;


Figure 3. One or The Other Not Both in Excel.

  1. Edit the formula in cell D2 above, and enter into the other cells in the RESULT column to get the desired results.

Figure 4. One or The Other Not Both in Excel.

The XOR Function one criteria and then the next criteria and gives us a TRUE or FALSE outcome.

The behavior of the XOR Function is called an “exclusive” behavior; in which just one outcome can be TRUE. Never both.

Figure 5. Final Result.

Instant Connection to an Expert through our Excelchat Service:

Our live Excelchat Service is here for you. We have Excel Experts available 24/7 to answer any Excel questions you may have. Guaranteed connection within 30 seconds and a customized solution for you within 20 minutes

Did this post not answer your question? Get a solution from connecting with the expert.

Another blog reader asked this question today on Excelchat:
Here are some problems that our users have asked and received explanations on

I have two excel sheets open - In one of them I pasted images from one tab to another, now both excel sheets will not save or close - keeps saying 'reference not valid' or just re-selects the images
Solved by G. Q. in 19 mins
Hi, I needed an excel formula to compare two columns, with either both not blank or one cell is blank in each case? Please any help?
Solved by X. L. in 26 mins
I am filtering two time columns in Excel for Mac 2011. One column filter allows (in the "Choose One" list) "Greater than" / "Greater than or equal to" etc whereas the other column filter (in the "Choose One" list) lists only "Begins with" / "Does not begin with" etc Both columns are formatted for Time in hh:mm format Why the discrepancy and how to solve it I want both to have "Greater than" / "Greater than or equal to" etc
Solved by O. Q. in 30 mins

Leave a Comment