## If Formula

Expert Estimation gives you the ability to set the quantity of a line item depending on the result of a true or false logic test, through the use of the If() formula.

The If() formula is available in all Cost Estimates, Resource Calculation Templates, Take Off Calculation Sheet and both Direct and Overhead Cost Schedules.

### SYNTAX

If(“Logic Condition”, Number ifTrue, Number ifFalse)

PARAMETER

DESCRIPTION

Logic Condition

The Logic Condition parameter represents a condition to be evaluated and will result as either True or False.

Number ifTrue

The Number ifTrue parameter represents a value that will be used as the result of the If() formula, when the Logic condition is evaluated as True.

Number ifFalse

The Number ifFalse parameter represents a value that will be used as the result of the IF() formula, when the Logic condition is evaluated as False.

Note: The parameters of an If() formula can be represented as a manually entered number, a mathematical equation or a define.

Example:

1. if(#LQ2 < 100, 0, 100)
This statement states If the quantity on line 2 is less than 100, output 0 if the quantity on line 2 is greater than 100, output 100.
2. if(#LQ1==30, 30, 100)
This statement states If the quantity on line 1 is equal to 30, the output value is 30, if the quantity on line 1 is not 30, the output value is 100.

If statements can be nested within each other to perform multiple tests on multiple values and return different values for all possible outcomes of the tests.

### LOGICAL OPERATORS

OPERATOR

DESCRIPTION

greater than (>)

Tests if one value is greater than another.

Example: If 1 is greater than 0 (1 > 0), this would be evaluated as a true result.

greater than or equal to (>=)

Tests if one value is greater than or equal to another.

Example: If 1 is greater than or equal to 1 (1 >= 1), this would be evaluated as a true result.

less than (<)

Tests if one value is less than another.

Example: If 0 is less than 1 (0 < 1), this would be evaluated as a true result.

less-than or equal-to (<=)

Tests if one value is less than or equal to another.

Example: If 1 is less than or equal to 1 (1 <= 1), this would be evaluated as a true result.

equal to (==)

Tests if one value is equal to another.

Example: If 1 is equal to 1 (1 == 1), this would be evaluated as a true result.

not equal to (!=)

Tests if one value is not equal to another.

Example: If 1 is not equal to 2 (1 != 2), this would be evaluated as a true result.

or (||)

Allows a condition parameter to be made of multiple conditions, only requiring one of these conditions to pass to represent a result of true.

Example: If 1 is equal to 1 or 2 (1 == 1 || 1 == 2), this would be evaluated as a true result.

and (&&)

Allows a condition parameter to be made of multiple conditions, requiring all conditions to pass to represent a result of true.

Example: If 1 is equal to 1 and less than 2 (1 == 1 && 1 < 2), this would be evaluated as a true result.