# If

Use the IF function, one of the logical functions, to return one value if a condition is true and another value if it's false.

# Syntax

=IF(condition, trueValue, falseValue)
For example:

• =IF([Field 1] > [Field 2], "Over Budget", "OK")
• =IF([Field 1] = 500, [Field 3] - [Field 2], "")

Argument name

Description

condition (required)

The condition you want to test.

trueValue (required)

The value that you want returned if the result of condition is "true".

falseValue (required)

The value that you want returned if the result of condition is "false".

# Examples

Actual Expense

Predicted Expense

\$1,500

\$900

\$500

\$900

\$525

\$925

=IF([Table]! > [Table]!, "Over Budget", "OK")

Because the actual expense of \$1500 ([Table]!) exceeded the predicted expense of \$900 ([Table]!), the result is Over Budget .

=IF([Table]! < [Table]!, "true", IF([Table]! > [Table]!, "over budget", "OK"))

The first IF function is false. Therefore, the second IF statement is calculated and because it too is false, the result is OK.

=IF([Table]!=500,[Table]!-[Table]!,"")

Because [Table]! equals 500, the Actual Expense \$500 is subtracted from Predicted Expense \$925 to tell you how much over budget you are. The result is 425. If [Table]! didn't equal 500, then empty text ("") would be returned.

=IF([Table]! < [Table]!, "true", IF([Table]! > [Table]!, "over budget", "OK"))

The first IF function is false. Therefore, the second IF statement is calculated and because it too is false, the result is OK.