XOR (Exclusive OR) function : how to use it in Excel

Learn what XOR means and how to use the Exclusive OR function in Microsoft Excel.

What does XOR mean and how to use the XOR function in Microsoft Excel? The XOR function is a logical function that will result in a positive (TRUE) or negative (FALSE) answer. You can add up to 254 conditions in its Boolean formula. Other Boolean functions in Excel are AND, OR and IF.

The syntax of the XOR function in Excel is =XOR(logical1,[logical2],…).

Ready to learn how to use the XOR function? Discover more information about this handy function in MS Excel below.

XOR means Exclusive (“X“) OR: the XOR function returns a logical Exclusive OR of all arguments.

The XOR syntax is =XOR(logical1,[logical2],…).

The first logical argument is required and you can add up to 254 conditions in the XOR function. The result of XOR will be TRUE or FALSE.

– The result of XOR is TRUE when the number of TRUE inputs is odd (numbers that cannot be divided entirely by 2).
– The result of XOR is FALSE when the number of TRUE inputs is even (numbers that can be divided entirely by 2).
– If none of the arguments are TRUE, the result of XOR will be FALSE.
– In Excel, the arguments must result in logical values or those values will be ignored by the system.
– If you need to mention a text element in a logical argument, use quotation marks: “text“. If you forget to do so, you will end up with an error: NAME?. The formula is not case sensitive.

XOR function in Excel with 2 values

In this example, we want to find clients who subscribed to our newsletter or who made less than 5 orders with us during the year, in order to send them a promotional code.
The XOR formula we use is =XOR(B22=”yes”,C22<5).

Ted is a subscriber (the first argument) but did not order less than 4 times with us: XOR result is TRUE because only 1 (odd number) logical value is TRUE.
Jordan is a subscriber (first argument) and ordered less than 5 times this year: XOR result is FALSE because 2 (even number) logical values are TRUE.
Marie is not a subscriber (first logical value is FALSE) and ordered 7 times with us this year (second logical value is FALSE): XOR result is FALSE because none of the arguments are TRUE.

XOR function in Excel with 3 values or more

Be careful when you use more than 2 logical values in the XOR formula!

We are using 3 logical arguments in the XOR function for this example:
1. Did the client make a purchase in Q1?
2. Did the client make a purchase in Q2?
3. Did the client make a purchase in Q3?

The XOR formula we use is =XOR(B22>0,C22>0,D22>0).

If the result of XOR is TRUE, it means the client ticks 1 or 3 of the arguments (like Marie who made 3 orders or David who made 1).
If the result of XOR is FALSE, it means the client ticks 0 or 2 of the arguments (like Ted who made 2 orders or Lisa who made 0).

Use the OR statement formula if you want to know if at least 1 argument is TRUE: =OR(B22>0,C22>0,D22>0).

Now, you know what XOR means and how to use the XOR function in Excel worksheets.

Depending on your situation, you might need to use other logical functions like IF or OR in Excel. We will cover these useful functions in other articles.

Master Microsoft Excel easily by checking more of our tutorials!

Advertising
Analytics

Categories

AllAdvertisingFormatsPlatformsKPI'sAd News
What is Programmatic Advertising?

What is Programmatic Advertising?

Understand what programmatic advertising is and how it works to increase your ROI and become a programmatic specialist.

Read More
Programmatic Advertising: What is a DSP?

What are DSPs?

A DSP is a great tool to use but what does DSP stand for in marketing? What are some Demand-Side Platforms examples? Today, we answer your questions!

Read More

Best DSPs for Programmatic Advertising

Ted Jordan shares his list of best DSPs for Programmatic Advertising so you don’t have to lose time searching the internet to find the right Demand-Side Platform for your campaigns.

Read More
Programmatic Advertising: What is a SSP?

Supply-Side Platforms (SSPs) Explained

SSPs basics in advertising: learn what Supply-Side Platforms are used for and who use them. Get familiar with more programmatic advertising technical terms.

Read More

What is O&O Advertising?

Discover one more important jargon term used in Programmatic Advertising: O&O advertising. Get familiar with O&O formats and advantages.

Read More
Programmatic: Pixels in Advertising 101

Advertising pixels: types, pros and best practices

Learn the basics of Programmatic Advertising with Ted Jordan! Today, we explain what a pixel is in advertising with simple words and expertise. Ready to learn?

Read More

Categories

AllFunctionsToolsShortcut Keys

How to change shapes in Excel column charts

Learn how to easily change the columns shape in your Excel charts so your colleagues and customers will remember your impacting graphs.

Read More

How to use the LEFT, RIGHT and MID functions

Learn how to extract text in Excel with the LEFT, RIGHT and MID functions. Plenty of examples to learn from and functions are explained with simple words. If you start...

Read More

Excel IF statement: how to use it for 3 conditions

Learn how to use the Excel IF statement with multiple conditions and combine it with OR and/or AND functions!

Read More
Navigating with Tab, Enter, and Shift Key on Excel.

How to move between cells when arrow keys are not working (Excel)

Learn how to move between Excel cells without using your mouse or arrow keys. Discover more shortcuts and tricks below!

Read More

How to use the IFERROR function (Excel + Google Sheets)

Discover how to use IFERROR in Excel or in Google Sheets in 4 easy steps! No more errors on your documents or dashboards with IFERROR.

Read More
Cope Paste Options on excel with shortcut keys

Copy paste values like a pro! (Excel+Google Sheets)

Copy and paste values (not formulas) using shortcut keys in Excel or Google Sheets! Learn how spreadsheets professionals do it within seconds and become one of them. Save time now...

Read More