In Excel, the If function returns one value if a specified condition evaluates to TRUE, or another value if it evaluates to FALSE.
If( condition, value_if_true, value_if_false ) condition is the value that you want to test. value_if_true is the value that is returned if condition evaluates to TRUE. value_if_false is the value that is return if condition evaluates to FALSE. For example: Let's take a look at an example:
Based on the Excel spreadsheet above: functions to create a complex IF THEN ELSE statement. 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
This syntax example demonstrates how to nest two IF functions. You can nest up to 7 IF functions. condition is the value that you want to test. value_if_true is the value that is returned if condition evaluates to TRUE. value_if_false is the value that is return if condition evaluates to FALSE. Applies To: For example: Let's take a look at an example:
Based on the Excel spreadsheet above:
The syntax for the If function is:
NESTED IF
=If(A1>10, "Larger", "Smaller") would return "Larger". =If(A1=20, "Equal", "Not Equal") would return "Not Equal". =If(A2="Tech on the Net", 12, 0) would return 12
It is possible to nest multiple IF functions within one Excel formula. You can nest up to 7 IF
value_if_true1
ELSEIF condition2 THEN
value_if_true2
ELSE
value_if_false2
END IF
=IF(A1="10X12",120,IF(A1="8x8",64,IF(A1="6x6",36))) would return 120 =IF(A2="10X12",120,IF(A2="8x8",64,IF(A2="6x6",36))) would return 64 =IF(A3="10X12",120,IF(A3="8x8",64,IF(A3="6x6",36))) would return 36
Subscribe to:
Post Comments (Atom)





0 comments
Post a Comment