Lesson 17: Excel Multiple IF Statements
Description
The IF function is a built-in function in Excel that is categorized as a Logical Function. It can be used as a worksheet function (WS) in Excel. As a worksheet function, the IF function can be entered as part of a formula in a cell of a worksheet.
It is possible to nest multiple IF functions within one Excel formula. You can nest up to 7
IF functions to create a complex IF THEN ELSE statement.
TIP: If you have Excel 2016, try the new
IFS function instead of nesting multiple IF functions.
Syntax
The syntax for the nesting the IF function is:
IF( condition1, value_if_true1, IF( condition2, value_if_true2, value_if_false2 ))
This would be equivalent to the following IF THEN ELSE statement:
IF condition1 THEN
value_if_true1
ELSEIF condition2 THEN
value_if_true2
ELSE
value_if_false2
END IF
Parameters or Arguments
- condition
- The value that you want to test.
- value_if_true
- The value that is returned if condition evaluates to TRUE.
- value_if_false
- The value that is return if condition evaluates to FALSE.
Description The IF function is a built-in function in Excel that is categorized as a Logical Function. It can be used as a worksheet function (WS) in Excel. As a worksheet function, the IF function can be entered as part of a formula in a cell of a worksheet. It is possible to nest multiple IF functions within one Excel formula. You can nest up to 7 IF functions to create a complex IF THEN ELSE statement. TIP: If you have Excel 2016, try the new IFS function instead of nesting multiple IF functions. Syntax The syntax for the nesting the IF function is: IF( condition1, value_if_true1, IF( condition2, value_if_true2, value_if_false2 )) This would be equivalent to the following IF THEN ELSE statement: IF condition1 THEN value_if_true1 ELSEIF condition2 THEN value_if_true2 ELSE value_if_false2 END IF Parameters or Arguments condition The value that you want to test. value_if_true The value that is returned if condition evaluates to TRUE. value_if_false The value that is return if condition evaluates to FALSE.