### Conditional Formula

If you want to perform a calculation when a cell contains a specific value you can create a conditional formula.

A conditional formula returns one value if the condition is True and a different value if the condition is False.

You can create a conditional formula by using the __IF Function__.

#### logical_test

This must be an argument that returns a logical (or boolean) value, either True or False.

You can use any combination of cell references, operators, constants and even other functions to create this logical test.

The following __Operators__ can be used to generate True or False values.

These operators include: greater than (>), less than (<) and equal to (=).

Cell E2 - Check if the value in cell "B2" is greater than 50. B2>50.

Cell E3 - Check if the value in cell "B3" is equal to the text "Monday". B3="Monday".

Cell E4 - Check if the total of the numbers in cells "C2:C4" is more than 200. __SUM__(C2:C4)>200.

#### value_if_true

This is the value that will be returned when the "logical_test" evaluates to True.

This argument can be anything that returns a value.

To return the text value True, you would use "true" (including the quotation marks).

You can include numbers, cell references, operands and even other functions, as long as they return a single value.

Cell E2 - Return the value that is the sum of the numbers in cells "C2", "C3" and "C4". C2+C3+C4.

Cell E3 - Return the value that is the sum of the numbers in cells "C2", "C3" and "C4". __SUM__(C2:C4).

Cell E4 - Return the value that is 5 times the value in cell "C2". 5*C2.

#### value_if_false

This is the value that will be returned when the "logical_test" evaluates to False.

This argument can be anything that returns a value.

Cell E2 - Return the value that is in cell "B2". B2.

Cell E3 - Return the value that is the number of cells in the range "C3:C4". __COUNT__(C3:C4).

Cell E4 - Return the value that is 20 plus 2 times 10. 20+(2*10).

#### NOT, AND and OR

These three functions are often included in the "logical_test" for slightly more advanced conditions.

Cell E3 - Return the opposite of a True or False value you would use the __NOT__ function.

Cell E4 - Return the logical AND for two different conditions you would use the __AND__ function.

Cell E5 - Return the logical OR for two different conditions you would use the __OR__ function.

#### Nested Functions

If you want to check for multiple conditions you can use "nested" IF functions.

When you nest the IF functions, you specify an IF function as the value of either of the "value_if_true" or "value_if_false". arguments

You can combine or nest up to 64 levels of IF functions within one formula.

#### Multiple Conditions

If you want to perform multiple conditions, instead of using nested IF functions you could use the __IFS__ function.

© 2021 Better Solutions Limited. All Rights Reserved. © 2021 Better Solutions Limited TopPrevNext