Advertisements

Excel XOR Function

The excel XOR function performs “exclusive OR” of all arguments. The XOR function has two logical statements, and it returns returns TRUE if either statement is TRUE. It returns FALSE if both statements are TRUE. If none is TRUE, XOR also returns FALSE.

In this section:

Advertisements

  1. Syntax of XOR function
  2. Create started and finished exam with XOR
  3. Create employee IN/OUT with XOR function
  4. One or more conditions with XOR function

Excel XOR Function to return started and finished.

1. Syntax of XOR function:

XOR(logical1, [logical2],…)

where:

2. Create started or finish exam:

To create started and finished exam, users need to combine XOR function with IF. Let’s think about a student’s starting and finishing exam. John will start at 8:00 AM and finish the exam at 2:00 PM. Now, the name John is present in the list twice. The first one (1) is for starting, and the second one (2) is for finishing. The odd number of presence means starting, and the even number of presence means finishing. For starting (1), the excel XOR function will return “TRUE“. In the example below, the formula is =IF(XOR(C6=C$6:C6), “Started”, “Finished”), which returns started if the student name is first time present.

The formula for:

Count =COUNTIF(C$6:C6, C6)

Odd: =ISODD(COUNTIF(C$6:C6, C6))

3. Employee IN/OUT with XOR function:

Applying the same logic, we can create employee IN/OUT. For odd number of presence of a name, XOR returns IN, and for even number of presence XOR returns OUT. In the example below, the formula is

Advertisements
Excel XOR function to create employee IN/OUT.

4. One/More conditions with XOR function:

For one or more conditions, users need to remember the following information:

  1. For a single argument, if the result is TRUE, XOR returns TRUE.
  2. For two arguments, if the results is TRUE, XOR returns TRUE.
  3. For more than two arguments, ODD number are true, then TRUE.

More readings:

  1. MS Office Post of XOR function
  2. Excel OR Function
  3. Excel NOT function
  4. Excel IFS Function
  5. Excel IFNA Function
  6. IFERROR Function
  7. Excel AND Function
  8. Excel IF function

2 Responses

Leave a Reply

Your email address will not be published. Required fields are marked *

Advertisements