# IF Function

Evaluates a logical expression and returns one value when true or another when false.
Sample Usage
IF([Due Date]1 > [Due Date]2, "Date 1 is Larger", "Date 2 is Larger")
Syntax
IF(
• logical_expression
• value_if_true
• [
value_if_false
]
)
• logical_expression
The expression to evaluate. Must be true or false.
• value_if_true
The value or formula to return if the logical expression is true.
• value_if_false
—[optional]
The value or formula to return if the logical expression is false. If omitted, a blank value is returned.
Usage Notes
• You can nest IF functions to perform multiple logical evaluations.
• Smartsheet reads the IF statements in the formula from left to right, displaying a value based on the first expression to evaluate to true. When nesting IF functions, the optional return_if_false will be returned only if all logical expressions evaluate to false.
Examples

This example references the following sheet information:

Row #

Item Number

Status

Order Date

In Stock?

1

C001

Green

12/15/19

true

2

C002

Red

12/12/19

false

3

C003

Yellow

12/15/19

true

4

C004

Green

12/20/19

true

Given the table above, here are some examples of using an IF() function in a sheet:

Formula

Description

Result

=IF([Status]1 = "Red", "At Risk", "On Time")

IF the ‘Status’ column row 1 equals “Red”, return the value "At-Risk”, if not return the value “On-Time”.

On-Time

=IF([Order Date]2<TODAY(), “Red”, IF([Order Date]2>TODAY(), “Yellow”,IF([Order Date]2=TODAY(), “Green”)))

IF the “Order Date” column row 2 is less than TODAY return a “Red” value. IF the “Order Date” column row 2 is greater than TODAY return a “Yellow” value. IF the “Order Date” column row 2 equals TODAY return a “Green” value.

Red

=IF([Order Date]3 < TODAY(), "Red", IF(AND([Order Date]3 >= TODAY(), [Order Date]3 < TODAY(+7)), "Yellow", "Green"))

IF the “Order Date” column row 3 is less than TODAY return a “Red” value. IF the “Order Date” column row 2 is greater than or equal to TODAY, AND less than the next 7 days, return a “Yellow” value. If neither applies return the value “Green”.

Yellow