Returns a specified value if the given logical argument is true.
and another specified value if the argument is false.
Syntax
IF (Logical, ValueIfTrue, ValueIfFalse)
Note: The required separator (comma or semi-colon) automatically corresponds to your computer’s location settings.
Data Types of the Arguments
Logical: True/False
ValueIfTrue, ValueIfFalse: Any Data Type, but Data Type must be identical for both Values
Data Type of the Result
Same Data type as the Values.
Example
Define the Beam Overhang standard depending on Beam length.
If the Beam is shorter than 480 cm, then the overhang should be 10 cm.
If it is longer than 480 cm, then the overhang should be 12 cm.
Expression
IF (Length Left <=480cm, 10 cm, 12 cm)
Result
10 for the shorter beams, 12 for the longer beams
Note
To test multiple conditions, it may be easier to use the IFS function.
See If Multiple [IFS].