+4 votes
77 views
in Office by (242k points)
reopened
Excel: Use the OR function correctly

1 Answer

+5 votes
by (1.6m points)
 
Best answer

How to use the OR function in Excel
OR function: example
Integrate the OR function in the IF function

The Excel "OR" function is used to determine whether a condition is TRUE. Read here how exactly it works..

image image

The OR function is a logical function and can check any number of conditions. The result returned in Excel is either "TRUE" or "FALSE". Accordingly, if either of the conditions is "TRUE", the result is also "TRUE". We explain how to use the function in Excel in our tips + tricks.

You can also read on here for tips on how to work efficiently with Excel.

How to use the OR function in Excel

The OR function is a logical function to test several conditions at the same time. OR returns either TRUE or FALSE. You can use any number of conditions as values ​​for the formula. If any of the arguments (conditions) evaluate to TRUE , the OR function returns TRUE . If all conditions evaluate to FALSE , the function returns the value FALSE . The fundamental difference to the AND function is that it is sufficient if a condition is met for the result to be TRUE. In summary, the formula looks like this:

=ODER(Bedingung1;[Bedingung2]; ...)

The OR function syntax has the following arguments:

Condition1: Required. The first condition to check that can be evaluated as either TRUE or FALSE..

Condition2: Optional. Additional conditions that can be tested.

OR function: example

The OR function can be used as a logical test, for example to check whether a color is "red" or "blue". The formula returns TRUE if either condition is true; FALSE otherwise .

image

The colors are in column B. To check the condition, whether the color is either red or blue, we enter the function in line D4

=ODER(B4="Blau";B4="Rot")

a. Pull down the green selection box to automatically transfer the function to the lines below. If any word in the cell matches either " blue " or " red ", the function returns TRUE . The function returns FALSE for the remaining colors ..

Integrate the OR function in the IF function

It is often not appropriate that the value of the output cell should only be TRUE or FALSE . With the IF function you can insert values ​​or words of your choice. The function is as follows:

=WENN(ODER(Bedingung1;Bedingung2);"Dann";"Sonst)

If we now want to receive the output " Yes " or " No " for our example , we change the function:

=WENN(ODER(B4="Blau";B4="Rot");"Ja";"Nein")

If the color is red or blue then the OR function is TRUE. The output can be adjusted as required using the IF function and the values ​​or words for " then " and " otherwise ".

image

...