Or Operator (|)

Use to combine two calculations. Either calculation must be true in order for the expression to be true.

Syntax

calculation1|calculation2

Example 1

C1000>=0|C100>=0

where C1000 = 1 and C100 = -50.

The first condition is true and therefore the expression is true.

Example 2

The above example can be used in conjunction with the IIF function to determine if the cell displays "Capital" or is blank.

IIF(C1000 = 1|C100 = 1,"Capital","")

where C1000 = 1 and C100 = 0

The preceding example may be evaluated as follows:

If C1000 is equal to 1 or C100 is equal to one, then display Capital. Only one of the cells must be equal to one in order for the condition to be true.

If neither C1000 nor C100 is equal to one, then display nothing.

In the case where C1000 = 1 and C100 = 0, the cell will display Capital.

Related Topics