# Logical

class
**Logical** (View source)

## Methods

TRUE.

FALSE.

LOGICAL_AND.

LOGICAL_OR.

LOGICAL_XOR.

NOT.

STATEMENT_IF.

IFERROR.

## Details

###
at line 19
```
static bool
```**true**()

**true**()

TRUE.

Returns the boolean TRUE.

Excel Function: =TRUE()

###
at line 36
```
static bool
```**false**()

**false**()

FALSE.

Returns the boolean FALSE.

Excel Function: =FALSE()

###
at line 89
```
static bool|string
```**logicalAnd**(mixed ...$args)

**logicalAnd**(mixed ...$args)

LOGICAL_AND.

Returns boolean TRUE if all its arguments are TRUE; returns FALSE if one or more argument is FALSE.

Excel Function: =AND(logical1[,logical2[, ...]])

```
The arguments must evaluate to logical values such as TRUE or FALSE, or the arguments must be arrays
or references that contain logical values.
Boolean arguments are treated as True or False as appropriate
Integer or floating point arguments are treated as True, except for 0 or 0.0 which are False
If any argument value is a string, or a Null, the function returns a #VALUE! error, unless the string holds
the value TRUE or FALSE, in which case it is evaluated as the corresponding boolean value
```

###
at line 132
```
static bool|string
```**logicalOr**(mixed ...$args)

**logicalOr**(mixed ...$args)

LOGICAL_OR.

Returns boolean TRUE if any argument is TRUE; returns FALSE if all arguments are FALSE.

Excel Function: =OR(logical1[,logical2[, ...]])

```
The arguments must evaluate to logical values such as TRUE or FALSE, or the arguments must be arrays
or references that contain logical values.
Boolean arguments are treated as True or False as appropriate
Integer or floating point arguments are treated as True, except for 0 or 0.0 which are False
If any argument value is a string, or a Null, the function returns a #VALUE! error, unless the string holds
the value TRUE or FALSE, in which case it is evaluated as the corresponding boolean value
```

###
at line 175
```
static bool|string
```**logicalXor**(mixed ...$args)

**logicalXor**(mixed ...$args)

LOGICAL_XOR.

Returns the Exclusive Or logical operation for one or more supplied conditions. i.e. the Xor function returns TRUE if an odd number of the supplied conditions evaluate to TRUE, and FALSE otherwise.

Excel Function: =XOR(logical1[,logical2[, ...]])

```
The arguments must evaluate to logical values such as TRUE or FALSE, or the arguments must be arrays
or references that contain logical values.
Boolean arguments are treated as True or False as appropriate
Integer or floating point arguments are treated as True, except for 0 or 0.0 which are False
If any argument value is a string, or a Null, the function returns a #VALUE! error, unless the string holds
the value TRUE or FALSE, in which case it is evaluated as the corresponding boolean value
```

###
at line 216
```
static bool|string
```**NOT**(mixed $logical = false)

**NOT**(mixed $logical = false)

NOT.

Returns the boolean inverse of the argument.

Excel Function: =NOT(logical)

```
The argument must evaluate to a logical value such as TRUE or FALSE
Boolean arguments are treated as True or False as appropriate
Integer or floating point arguments are treated as True, except for 0 or 0.0 which are False
If any argument value is a string, or a Null, the function returns a #VALUE! error, unless the string holds
the value TRUE or FALSE, in which case it is evaluated as the corresponding boolean value
```

###
at line 267
```
static mixed
```**statementIf**(mixed $condition = true, mixed $returnIfTrue = 0, mixed $returnIfFalse = false)

**statementIf**(mixed $condition = true, mixed $returnIfTrue = 0, mixed $returnIfFalse = false)

STATEMENT_IF.

Returns one value if a condition you specify evaluates to TRUE and another value if it evaluates to FALSE.

Excel Function: =IF(condition[,returnIfTrue[,returnIfFalse]])

```
Condition is any value or expression that can be evaluated to TRUE or FALSE.
For example, A10=100 is a logical expression; if the value in cell A10 is equal to 100,
the expression evaluates to TRUE. Otherwise, the expression evaluates to FALSE.
This argument can use any comparison calculation operator.
ReturnIfTrue is the value that is returned if condition evaluates to TRUE.
For example, if this argument is the text string "Within budget" and the condition argument evaluates to TRUE,
then the IF function returns the text "Within budget"
If condition is TRUE and ReturnIfTrue is blank, this argument returns 0 (zero). To display the word TRUE, use
the logical value TRUE for this argument.
ReturnIfTrue can be another formula.
ReturnIfFalse is the value that is returned if condition evaluates to FALSE.
For example, if this argument is the text string "Over budget" and the condition argument evaluates to FALSE,
then the IF function returns the text "Over budget".
If condition is FALSE and ReturnIfFalse is omitted, then the logical value FALSE is returned.
If condition is FALSE and ReturnIfFalse is blank, then the value 0 (zero) is returned.
ReturnIfFalse can be another formula.
```

###
at line 289
```
static mixed
```**IFERROR**(mixed $testValue = '', mixed $errorpart = '')

**IFERROR**(mixed $testValue = '', mixed $errorpart = '')

IFERROR.

Excel Function: =IFERROR(testValue,errorpart)