Logical Formulas
9 Oct 20193 minutes to read
AND
Returns true when all the arguments have a logical value of True and returns false when at least one argument is False.
Syntax:
AND(logical1, logical2, …)
where:
- logical1, logical2 … are multiple conditions to be tested for
trueorfalse.
Remarks:
-
The arguments must evaluate to logical values (True or False).
-
When an argument does not evaluate to True or false, those values are ignored.
-
There must be at least one value in the argument list.
FALSE
The False function returns the logical value for the false.
Syntax:
FALSE(stringvalue)
where:
- stringvalue is to provide an empty string.
IF
Returns one value when a condition you specify evaluates to True and another value when it evaluates to False.
Use If to conduct conditional tests on values and formulas.
Syntax:
IF(logical_test, value_if_true, value_if_false)
where:
-
logical_test is any value or expression that can be evaluated to
TrueorFalse. -
value_if_true is the value that is returned if a logical_test is
True. -
value_if_false is the value that is returned if a logical_test is
False.
Remarks:
- Countif and Sumif are additional methods that provide conditional calculations.
IFERROR
IfError function tests when an initial given value (or expression) returns an error, and then, this function returns a second given argument. Otherwise, the function returns the initial tested value.
Syntax:
IFERROR (value, value_error)
where:
-
valueis the required to check the error. -
value_erroris the required and returns when the value has an error. -
When the value_error is an empty cell, then the function takes the error value as empty string.
IFNA
IFNA function returns the value specified when the formula returns the #N/A error value; otherwise, it returns the result of the given formula.
Syntax:
IFNA (Formula_value, value_if_na)
where:
-
Formula_value: This value is required and the argument that is checked for the #N/A error value. -
value_if_na: This value is required and the value returned when the formula evaluates to the #N/A error value.
IFS
IFS function evaluates one or more logical conditions and returns corresponding value of the first true condition.
Syntax:
IFS(logical_test1, value_if_true1,[ logical_test2, value_if_true2, ….])
where:
-
logical_test1is any value or expression that can be evaluated toTrueorFalse. -
value_if_trueis the value returned if the corresponding condition isTrue.
Remarks:
-
If no
Truecondition is found, this function returns#N/Aerror string. -
If a logical_test argument gives a value other than true or false, this function returns
#VALUE!error. -
If a logical_test argument does not have a corresponding value_if_true, the error message
Error: you have entered too few arguments in this functionis shown.
NOT
The Not function reverses the value of its argument.
Syntax:
NOT(logical)
where:
- logical is a value or expression that can be evaluated to
TrueorFalse.
TRUE
The True function returns the logical value for True.
Syntax:
TRUE(stringvalue)
where:
- stringvalue is to provide an empty string.
OR
Returns True when any argument is True returns False when all arguments are False.
Syntax:
OR(logical1, logical2, …)
where:
- logical1, logical2 … are conditions to test that can be either
TrueorFalse.
Remarks:
- The arguments must evaluate to logical values such as
TrueorFalseor in arrays or references that contain logical values.
XOR
XOR function returns the exclusive OR for the given arguments.
Syntax:
XOR (logical_value1, logical_value2…)
where:
-
Logical_value1: This is a required value and can be either
trueorfalse, and can be logical values, arrays, or references. -
When the given arguments do not have the logical values,
XORreturns the#VALUE!error value.