Movatterモバイル変換


[0]ホーム

URL:


Menu
×
See More 
Sign In
+1 Get Certified Upgrade Teachers Spaces Get Certified Upgrade Teachers Spaces
   ❮   
     ❯   

Excel Tutorial

Excel HOMEExcel IntroductionExcel Get StartedExcel OverviewExcel SyntaxExcel RangesExcel FillExcel Move CellsExcel Add CellsExcel Delete CellsExcel Undo RedoExcel FormulasExcel Relative ReferenceExcel Absolute ReferenceExcel Arithmetic OperatorsExcel ParenthesesExcel Functions

Excel Formatting

Excel FormattingExcel Format PainterExcel Format ColorsExcel Format FontsExcel Format BordersExcel Format NumbersExcel Format GridsExcel Format Settings

Excel Data Analysis

Excel SortExcel FilterExcel TablesExcel Conditional FormatExcel Highlight Cell RulesExcel Top Bottom RulesExcel Data BarsExcel Color ScalesExcel Icon SetsExcel Manage Rules (CF)Excel Charts

Table Pivot

Table Pivot Intro

Excel Case

Case: Poke MartCase: Poke Mart, Styling

Excel Functions

ANDAVERAGEAVERAGEIFAVERAGEIFSCONCATCOUNTCOUNTACOUNTBLANKCOUNTIFCOUNTIFSIFIFSLEFTLOWERMAXMEDIANMINMODENPVORRANDRIGHTSTDEV.PSTDEV.SSUMSUMIFSUMIFSTRIMVLOOKUPXOR

Excel How To

Convert Time to SecondsDifference Between TimesNPV (Net Present Value)Remove Duplicates

Excel Examples

Excel ExercisesExcel SyllabusExcel Study PlanExcel CertificateExcel Training

Excel References

Excel Keyboard Shortcuts


Excel XOR Function


XOR Function

TheXOR function is a premade function in Excel, which returnsTRUE orFALSE based on two or moreconditions.

Note: The XOR function is often used together with theIF function.

It is typed=XOR:

=XOR([logical1],[logical2], ...)

Theconditions are referred to as[logical1],[logical2], and so on.

The conditions can check things like:

  • If a number isgreater than another number>
  • If a number issmaller than another number<
  • If a number or text isequal to something=

For two conditions, you can think of the XOR function as:"either thisor that, butnot both"

Note: The different parts of the function are separated by a symbol, like comma, or semicolon;

The symbol depends on yourLanguage Settings.


Example XOR Function

Check if the Pokemon type is either Fire typeOR has HPless than 60, butnot both:

The function returns "TRUE" or "FALSE".

Copy Values

ExampleXOR function, step by step:

  1. Select the cellD2
  2. Type=XOR
  3. Double click theXOR command

  1. Specify the first conditionB2="Fire"
  2. Type,
  3. Specify the second conditionC2<60
  4. Hit enter

Note: You can add more conditions by repeating steps 5-6 before hitting enter.

The XOR function returns "TRUE" if anodd number (1,3,5,..) of conditions areTRUE.

Since the value in cellB2 is not "Fire" the first condition isFALSE.

Since the value in cellC2 is less than 60 the second condition isTRUE.

For two conditions,only one condition should to beTRUE for the XOR function to returnTRUE.

Note: Text values needs to be in quotes: " "


The function can be repeated with thefilling function for each row to perform the same check for each Pokemon:

Now, each row has a check for Fire Typeor HP less than 60, butnot both:

For example:

  • Ivysaur isnot Fire type, but it also does not haveless than 60 defense, so the function returns "FALSE".
  • Charmeleonis Fire type, and hasless than 60 defense, so the function returns "FALSE"
  • Wartortle isnot Fire type, but hasless than 60 defense, so the function returns "TRUE"


Example XOR Function (with IF)

Combining the XOR function with anIF function lets you checkmultiple conditions for the IF function:

Note: The IF function lets you specify the return values.

The IF function is typed=IF and has 3 parts:

=IF(logical_test,[value_if_true],[value_if_false])

The XOR function takes the place of thelogical_test condition.

Here, theIF function returns "Yes" or "No".

ExampleXOR function as the condition forIF function, step by step:

  1. Select cellC2
  2. Type=IF
  3. Double click theIF command

  1. TypeXOR
  2. Double click theXOR command

  1. Specify the first conditionB2="Fire"
  2. Type,
  3. Specify the second conditionC2<60
  4. Type),
  5. Specify the value"Yes" for when just one condition isTRUE
  6. Type,
  7. Specify the value"No" for when both areFALSE, orTRUE at the same time
  8. Type) and hit enter

The function can be repeated with thefilling function for each row to perform the same check for each Pokemon:

Now, each row has a check for Water Typeor Defense greater than 60, butnot both:

For example:

  • Ivysaur isnot Fire type, but it also does not haveless than 60 defense, so the function returns "No".
  • Charmeleonis Fire type, and hasless than 60 defense, so the function returns "No"
  • Wartortle isnot Fire type, but hasless than 60 defense, so the function returns "Yes"


×

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
sales@w3schools.com

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail:
help@w3schools.com

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning.
Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness
of all content. While using W3Schools, you agree to have read and accepted ourterms of use,cookies andprivacy policy.

Copyright 1999-2025 by Refsnes Data. All Rights Reserved.W3Schools is Powered by W3.CSS.


[8]ページ先頭

©2009-2025 Movatter.jp