All Shortcut Keys of MS WORD
All Shortcut Keys of MS WORD
All Shortcut Keys of MS WORD
Parameters or Arguments
condition
The value that you want to test.
value_if_true
It is the value that is returned if condition evaluates to TRUE.
value_if_false
Optional. It is the value that is returned if condition evaluates to FALSE.
Returns
The IF function returns value_if_true when the condition is TRUE.
The IF function returns value_if_false when the condition is FALSE.
The IF function returns FALSE if the value_if_false parameter is omitted and the
condition is FALSE.
Based on the Excel spreadsheet above, the following IF examples would return:
=IF(B2<10, "Reorder", "")
Result: "Reorder"
=IF(B3>=20, 12, 0)
Result: 12
IF( condition1, value_if_true1, IF( condition2, value_if_true2,
value_if_false2 ))
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.
Note
This Nested IF function syntax demonstrates how to nest two IF functions. You can nest
up to 7 IF functions.
Applies To
Excel for Office 365, Excel 2019, Excel 2016, Excel 2013, Excel 2011 for Mac, Excel
2010, Excel 2007, Excel 2003, Excel XP, Excel 2000
Type of Function
Worksheet function (WS)
Based on the Excel spreadsheet above, the following Nested IF examples would return:
=IF(A1="10x12",120,IF(A1="8x8",64,IF(A1="6x6",36)))
Result: 120
=IF(A2="10x12",120,IF(A2="8x8",64,IF(A2="6x6",36)))
Result: 64
=IF(A3="10x12",120,IF(A3="8x8",64,IF(A3="6x6",36)))
Result: 36