IF(logical_test, [value_if_true], [value_if_false])
- logical_test (Required): Any value or expression that can be calculated to give TRUE or FALSE answer.
- value_if_true (Optional): Value or calculation that you want to be returned when the logical_test argument evaluates to TRUE. For instance, if the value of this argument is "Under 50" and the logical_test argument evaluates to TRUE, the IF formula returns the text "Under 50". When logical_test calculates to TRUE and the value_if_true argument is not provided IF formula will return 0.
- value_if_false (Optional): The value or calculation that you want to be returned if the logical_test argument calculates to FALSE. For instance, if the value of this argument is the text string "Over 50" and the logical_test argument calculates to FALSE, the IF formulas returns the text "Over 50". As above, if value_if_false is not provided IF formulas will return 0.
- Up to 64 IF formulas can be written as value_if_true and value_if_false arguments to create more comprehensive tests. Otherwise, to assess multiple conditions, you might consider using the LOOKUP, VLOOKUP, HLOOKUP, or CHOOSE functions.
- If any of the arguments to IF formula are arrays, every element of the array is evaluated when the IF statement is calculated.
- Excel provides many other formulas that can be used to analyze your data based on a condition. For instance, to count the number of occurrences of a series of text or a number within a range of cells, use the COUNTIF or the COUNTIFS excel formulas. To calculate a Total based on a series of text or a number within a range, use the SUMIF or the SUMIFS.
- Equals (=), Less than (<), Less than or equal to (<=), Greater than (>), Greater than or equal to (>=), Not equal to (<>).